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
-
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 -
301 redirects for all urls - legal dispute
The website in question is a very high traffic website with substantial credibility in it's subject matter (sorry, can't share more details) that delivers an overwhelming majority of traffic from SEO, much of which is new visitors. A legal dispute has resulted in both parties agreeing to forward a percentage of the total URLs to alternative websites (only 1 website for each party). All URLs for the domain will be forwarded elsewhere. It does not make sense to me that the "sum of the parts" will be as strong once the redirects are implemented but I am looking for feedback. It is fair to say that the alternative domains of each party are no where near as strong as the domain being "parted out." Will the SEO juice be distributed to each domain in full? Will both parties lose out substantially? Feel free to ask for clarifications and I'll do the best I can given the legal parameters. Thanks.
Technical SEO | | ReachMaineAgency0 -
Added 301 redirects, pages still earning duplicate content warning
We recently added a number of 301 redirects for duplicate content pages, but even with this addition they are still showing up as duplicate content. Am I missing something here? Or is this a duplicate content warning I should ignore?
Technical SEO | | cglife0 -
Redirect URLS with 301 twice
Hello, I had asked my client to ask her web developer to move to a more simplified URL structure. There was a folder called "home" after the root which served no purpose. I asked for the URLs to be redirected using 301 to the new URLs which did not have this structure. However, the web developer didn't agree and decided to just rename the "home" folder "p". I don't know why he did this. We argued the case and he then created the URL structure we wanted. Initially he had 301 redirected the old URLS (the one with "Home") to his new version (the one with the "p"). When we asked for the more simplified URL after arguing, he just redirected all the "p" URLS to the PAGE NOT FOUND. However, remember, all the original URLs are now being redirected to the PAGE NOT FOUND as a result. The problems I see are these unless he redirects again: The new simplified URLS have to start from scratch to rank 2)We have duplicated content - two URLs with the same content Customers clicking products in the SERPs will currently find that they are being redirect to the 404 page. I understand that redirection has to occur but my questions are these: Is it ok to redirect twice with 301 - so old URL to the "p" version then to final simplified version. Will link juice be lost doing this twice? If he redirects from the original URLS to the final version missing out the "p" version, what should happen to the "p" version - they are currently indexed. Any help would be appreciated. Thanks
Technical SEO | | AL123al0 -
When is it safe to remove 301 redirects?
I have created over 500 301 redirects in my .htaccess file, some of them are more than 2 years old now. Should I delete them? I don't like seeing the "notices" number in crawl diagnostics so high 😞
Technical SEO | | danielshaw0 -
What tools produce a complete list of all URLs for 301 redirects?
I am project managing the rebuild of a major corporate website and need to set up 301 redirects from the old pages to the new ones. The problem is that the old site sits on multiple CMS platforms so there is no way I can get a list of pages from the old CMS. Is there a good tool out there that will crawl through all the sites and produce a nice spreadsheet with all the URLs on it? Somebody mentioned Xenu but I have never used it. Any recommendations? Thanks -Adrian
Technical SEO | | Adrian_Kingwell0 -
301 redirects for individual products - should I keep the old ones?
Hello We are just now starting up a niche site that will be the new home for a large group of products from an old site. Apart from straight up informative text links, we have set up 301 redirects for the 100 most important products from the old to the new site. Right now, we are in a transition period where we openly tell our visitors that we have a new site for this certain group of products. My question is: for how long should we keep the products on the old site? Can we remove them straight away, since our intentions of the 301 redirects is to preserve the serp positions for the most important products? Does it matter to google if we let the products remain on the old site for a while? Regards
Technical SEO | | jsigwid
Oskar0