Setting up a 301 redirect from expired webpages
-
Hi Guys,
We have recently created a new website for one of our clients and replaced their old website on the same domain. One problem that we are having is that all of the old pages are indexed within Google (1000s) and are just getting sent to our custom 404 page. We are finding that there is an large bounce rate from this and also, I am worried from an SEO point of view that the site could lose rank positioning through the number of crawl errors that Google is getting.
Want I want is to set up a 301 redirect from these pages to go to the 'our brands' page. The reason for this is that the majority of the old URLs linked to individual product pages, and one thing to note is that they are all .asp pages.
Is there a way of setting up a rule in the htaccess file (or another way) to say that all webpages that end with the suffix of .asp will be 301 redirected to the our brands' page? (there is no .asp pages on the new site as it is all done in php).
If so, I would love it if someone could post the code snippet. Thanks in advance guys and if you have any other ideas then be my guest to suggest
Matt.
-
Make sure and back up you .htaccess before making any changes...
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^(.*).asp$ $1.php [R=301,L]Would convert all asp to php
but this would only work if you kept your directory structure the same
Example
Old Structure http://www.somedomain.com/about.asp
New Structure http://www.somedomain.com/about.php
If you did not you will need to do it manually for each page
Redirect 301 /about.asp http://www.somedomain.com/about-Us.php
If there are spaces, be sure to use quotes
Redirect 301 "/about us.asp" http://www.somedomain.com/about-Us.php
There could be other easier ways, but if I read correctly above, this would be my suggestions
And of course as TIm suggests above, the proper SEO process would be manually for each page, redirecting to its proper counterpart (if it is indexed, and has links pointing to it or a User Experience page)
Shane
-
To answer your question directly - yes, there's a rule to put in .htaccess for this. It would be something like:
RewriteRule (.*).asp$ http://www.link.to/ourbrandspage (someone who knows regex better may correct me on this)
However, redirecting everything to the same page is a bit of a waste - if the site has been around for a long time, then there may be inbound links to deep pages in the site which would be better off being redirected to the appropriate page on the new URL structure rather than dumping everyone on the same page.
If there's a pattern match which you can follow, then you can write regex to cope with this (e.g. if the old structure was http://www.whatever.com/blah.asp and the new one is http://www.whatever.com/blah.php then just do an .htaccess redirect from *.asp to .php - something like RewriteRule (.).asp $1.php). However, I'm going to bet it's not that simple.
Best is to do a proper map of existing links so you can direct the actual old URL to the most relevant URL on the new site.
I've had to do this kind of "emergency redirect fix" before, for sites with a lot of pages and no neat "pattern match" fix. The way I usually approach it is to try and get a list of the existing URL structure (either: from a back up version of the site, from Google analytics, from webmaster tools or at a pinch you can scrape the SERPs) to grab all the possible/indexed URLs and stick them in a spreadsheet. I then prioritise the highest traffic pages - if you can see via Google Analytics (or server logs) which pages get the most inbound traffic, redirect those first to the most appropriate page on the new structure. That way you can carry on adding new rules into the .htaccess as you go along - you'll probably find of the 1000s of old pages, there's a relatively small %age which get the vast majority of inbound traffic.
Hope this helps!
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
Unsolved Temporary redirect from 302 to 301 for PNG File?
#302HTTP #temporaryredirect
Technical SEO | | Damian_Ed 0
Hi everyone, Recently I have faced a crawl issue with my media images on website. For example this page url https://intreface.com/wp-content/uploads/2022/12/Horion-screen-side-2.png has 302 HTTP Status and the recommendation is to change it 301. I have read the article on temporary redirections here:
https://moz.com/learn/seo/redirection?_ga=2.45324708.1293586627.1702571936-916254120.1702571936
but its not written here how to redirect in my HTML 1 image url not the landing page.
Screenshot 2023-12-15 at 11.02.40.png
I have messaged to MOZ Support but they recommended to go for the MOZ Community!
Screenshot 2023-12-15 at 11.06.02.png Could you assist me wit this issue please? I can reach HTTML of the necessary page and change what I need for permanent redirection but firstly I need to understand how to do that correctly.0 -
Should we set up redirects for all deleted TAGS?
We recently found our site had 65,000 tags (yes 65K). In an effort to consolidate these we've started deleting them. MOZ is now reporting a heap of 404 errors for tag pages. These tag pages should not have links to them so not sure how come they're being crawled. Any suggestions from experience in this area would be useful.
Technical SEO | | wearehappymedia0 -
301 redirected all my pages to my new domain, now I have a problem with Google Search Console
Hi guys! I bought a new domain name and redirected all my URLs from the old domain to the new one. Everything worked perfectly but now I have a little problem. I want to use the option 'Address Change' in google search console. Step 1 Works (Select new website in the list) Step 2 Works (Confirm that the 301 are working) Step 3 Asks me to Verify the old domain (huh!?) in order to complete the request. Obviously that doesn't work because my 301s WORKS! So if I try to verify the old website by putting a google file in the root of my domain Google tries to access it and it automatically redirects to the new domain. I must be missing something lol help!
Technical SEO | | benoit_20180 -
Can I Get Penalized for 301 Redirects (Too Many or In Any Scenario)?
A client of ours owns several domain names that are keyword similar to the domain they actually use to run their site. They are asking us if we should 301 redirect all of these websites to the domain they use. However, I don't want this to work against them and their site get penalized later for this. I have heard buying out competitors and redirecting their domain to yours is frowned upon and penalized when you get caught (they did not do this). We are also wondering if there is a limit as to how many domains you can 301 redirect and what type (keyword similar, misspellings, .net's, etc.) and if you are penalized after too many (i.e. >50). All of the domains in question are keyword/brand name similar only and do not exist as actual websites. We just want to do the right thing. Thank you for your help.
Technical SEO | | JCunningham0 -
How to create a delayed 301 redirect that still passes juice?
My company is merging one of our sites into another site. At first I was just going to create a 301 redirect from domainA.com to domainB.com but we decided that would be too confusing for customers expecting to see domainA.com so we want to create a page that says something like "We've moved. please visit domainB.com or be redirected after 10 seconds". My question is, how do I create a redirect that has a delay and will this still pass the same amount of juice that a regular 301 redirect would? I've heard that meta refreshes are considered spammy by Google.
Technical SEO | | bewoldt0 -
301 redirect Issues
my clients site is www.greenbayharvest.co.uk When you enter that URL it redirects to www.greenbayharvest.co.uk/shop, dont ask why, thats the way they set it up and thats what im stuck with. So, how do i resolve the 301 issue here. we want all things to point to www.greenbayharvest.co.uk, in terms of SEO but does the fact that there is a redirect going to /shop make this an issue? we appear to have: www.greenbayharvest.co.uk/shop www.greenbayharvest.co.uk greenbayharvest.co.uk greenbayharvest.co.uk/shop all these URL's go to the same same page so what is the best way to correct this? thanks for any help on this Lee
Technical SEO | | IPIM0 -
What are the SEOmoz-suggested best practices for limiting the number of 301 redirects for a given site?
I've read some vague warnings of potential problems with having a long list of 301 redirects within an htaccess file. If this is a problem, could you provide any guidance on how much is too much? And if there is a problem associated with this, what is that problem exactly?
Technical SEO | | roush0