301 redirects
-
Hello.
Our site was recently rebuilt, and we switched from using index.php in all the urls to not using it at all. We also changed the names of many of our pages. So the urls have been renamed from "example.com/index.php/old_page_name/" to "example.com/new-page-name/". While we were at it, we changed from "_" to "-" as our word separators in the urls.
In the .htaccess file, we have a small block of code that strips out "index.php/" from all requests. This code redirects a request for "example.com/index.php/old_page_name/" to "example.com/old_page_name/"
For your information, the code that strips out "index.php/" is:
RewriteCond %{THE_REQUEST} ^GET.index.php [NC]
RewriteCond %{THE_REQUEST} !/uSZWTLna/.
RewriteRule (.?)index.php/(.*) /$1$2 [R=301,L]Then we have 301 redirects from "example.com/old_page_name/" to "example.com/new-page-name/"
QUESTION 1: Is this two-step redirect approach okay, or would it be better to skip the separate index.php stripping code and simply have 301 redirects that include "index.php" in the urls?
QUESTION 2: Will we lose some of the benefit of the links that have to pass through a 301 redirect?
QUESTION 3: We have 50 or so redirects. Will this affect performance of the site? How many redirects does it take to start affecting performance?
Thank you!
-
Thank you, Nakul!
-
If you only have 50 or do redirects that you have a list for, I would advise a 1 to 1 redirect. Ie.
domain.com/index.php/red_widgets/ is changing to domain.com/red-widgets/
There's no point in redirecting /index.php/red_widgets/ to domain.com/red_widgets/ which you know does not exist.
It would be wiser to just setup redirects directly from /index.php/red_widgets/ to /red-widgets/ without another step in between. I know that might mean you might not be able to do regular expression, but since you are dealing with 50 redirects only, it's not a big deal.
Regarding the number of redirects, I won't worry about 50 redirects.
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
-
Should I set 301 Redirects or keep old permalinks?
I just built a new site for a client and the new site has pretty links like domain.com/about-us. The old site has been around for a VERY long time and had links like domain.com/aboutus. I want to do 301 redirects because from my understanding, it minimizes the negative SEO impact. But the client wants to keep the permalinks without the hyphens to match the old links. What is the best route, considering SEO? BTW, the site is still on the same domain. Thanks in advance for your help! Neik
Technical SEO | | glassh0use0 -
Ranking for non-existing content which is 301 redirected
Hey there, In the beginning of this year I've made complete site migration from Dutch language to English. All the old Dutch URL's were 301 redirected to the English versions. I naturally lost rankings for all Dutch keywords during the next month. On the website there is no Dutch content anymore. But what happened now is that five months later the website started to rank for the Dutch keywords again. The page snippets in SERP are in English but the URL's shown are in Dutch (ending with .nl) and whenever a user clicks on the snippet he/she gets 301 to the correct English version. Any ideas what could be the reason for re-ranking of non-existing pages which gets 301 in SERP?
Technical SEO | | benesmartin0 -
301 redirecting a previously abused URL
A client previously had their most important landing page at domain.com/example.htm They carried out the sort of link building that was commonplace a few years back (exact match anchors, paid blog links etc) targeting this URL, but they also got a bunch of legitimate decent quality links here. I believe they may have had a number of issues when link quality algo updates were rolled out, so rather than try and get links removed and go through the disavow process they instead decided to abandon this URL, let it 404 and start afresh at domain.com/example.html - updating all internal navigation, XML sitemaps etc. So fast forward to today. What is the best practice for this URL these days do we think? Is it now possible to 301 domain.com/example.htm > domain.com/example.html and recover whatever value may be left here? The argument for not doing so may be that you could pass over the negative metrics associated with the old URL, but would this not be handled by the real-time penguin update and the poor links just devalued rather than actually harming? And could this just be tested - i.e. add in the 301, monitor the impact and if things don't go the way we'd want then just remove the 301 again? Would be keen to get a few opinions on this. TIA
Technical SEO | | Salience_Search_Marketing0 -
Htaccess redirects
Annoyingly it's time to play with this beast again. I've been given the task of doing the following. Keeping the homepage live Redirecting categories to the specific categories on the new site Catch all redirects Now i've managed to setup the specific categories and the catch all redirects, however I am unsure how to keep the homepage live (which is like this:www.domain.com/ so I can't just exclude that?) Would appreciate any help.
Technical SEO | | ThomasHarvey0 -
301 redirect: canonical or non canonical?
Hi, Newbie alert! I need to set up 301 redirects for changed URLs on a database driven site that is to be redeveloped shortly. The current site uses canonical header tags. The new site will also use canonical tags. Should the 301 redirects map the canonical URL on the old site to the corresponding canonical for the new design . . . or should they map the non canonical database URLs old and new? Given that the purpose of canonicals is to indicate our preferred URL, then my guess is that's what I should use. However, how can I be sure that Google (for example) has indexed the canonical in every case? Thx in anticipation.
Technical SEO | | ztalk1120 -
Is page rank lost through a 301 redirect?
Hi everyone. I'd really appreciate your help with this one 🙂 I've just watched Matt Cutt's video 'what percentage of PageRank is lost through a 301 redirect?' and I am confused. I had taken this to mean that a re-direct would always lose you page rank, but watching it again I am not so sure. He says that the amount of page rank lost through a 301 redirect is the same as any other link. Does this mean that no page rank at all is lost during site migrations? Or is it the case that first page rank would be lost from the original link and then more page rank would be lost from any subsequent redirects? watch?v=Filv4pP-1nw
Technical SEO | | RG_SEO0 -
301 Redirect How Long until the juice passes through to new site
Hi Guys, Following on from a question i asked last week in regard to a 301 http://www.seomoz.org/q/301-redirect-have-no-ranking I was thinking that i had some kind of issue on the site, although i have gone over it with a fine tooth comb i cannot find any issue's and from the amount of reads the thread has had im sure if there was something obvious it would have been pointed out. So i am quite confident the 301 from site A to site B is fine and working as intended, so my question is how long should it take until the juice is passed From site A to Site B as its 9 weeks now and still down 85% on traffic and even text for my home page if copied into the search bar don't bring up my site Bing is fine and did not see any real traffic drops but Google is not giving me back the rankings i had prior Whenever i have done a 301 before the rankings pretty steady and i see no real loss in rankings but this time ... painful all changes in WMT made
Technical SEO | | kellymandingo
Canonical tag implemented
all Pages 301 and correct 200 response from the targeted page
Sitemap Updated
Many Links Changed from Old site to new (including DMOZ)
no Robots text Blocking directory's
Google crawling freely and regularly The strange thing is New content is indexed immediately and ranks easily, I added a page for my service in my local area and went straight to position 5 in Google however old existing content wont move, I tracked 150 keywords only 4 are top 75 Don't know what else to do so any advice would be much appreciated PS site is around 17k pages Paul0 -
301 Redirect & Cloaking
HEllo~~~~ People. I have a question regarding on cloaking. I will be really greatful if you can help me with question. I have a site www.example.com and it is targeting for multi countries. So I use sub directories for targeting multi countries. e.g. www.example.com/us/ www.example.com/de/ www.example.com/hk/ ....... so on and on. Therefore, when people type www.example.com, I use IP delivery to send users to each coutries. Here is my question. I use 301 redirect for IP delivery, which means when user enter www.example.com, my site read user's IP and send them to right country site by 301 redirect. In this case, is there any possibility that Google considers it as cloaking? Please people.... share me some ideas and thoughs.
Technical SEO | | Artience0