Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
301 Redirects - Large .htaccess file question
-
We are moving about 5000 pages from root into different folders. We need to individually 301 each page because the are sitting at root level now:
We want to move them to: mysite.com/folder/page.html etc
I dont think redirect match can works because of the different files names and folders they are being moved in to.
Will 5000 entries in .htacess slow site loading? Any other suggestions how to handle?
-
@leadforms
Try this format via your .htaccess# Enable Rewrite Engine RewriteEngine On RewriteBase / # Individual 301 Redirects Redirect 301 /page1.html /folder1/page1.html Redirect 301 /page2.html /folder2/page2.html Redirect 301 /page3.html /folder3/page3.html # ... (and so on for the other 4997 pages) # If there are other specific redirects unrelated to the pages being moved, you can add them here as well.
I hope it helps you.
-
Sorry I meant to add some links that might be useful.
here they are
https://moz.com/community/q/will-301-redirects-slow-page-speed
https://moz.com/blog/heres-how-to-keep-301-redirects-from-ruining-your-seo
https://moz.com/community/q/massive-301-permanant-redirects This is an older question on here but may have some useful insights.
https://webmasters.stackexchange.com/questions/113246/does-too-many-301-redirects-harm-serp-rankings
http://www.thesempost.com/best-practices-for-301s-in-large-htaccess-file/
-
Hi Leadforms,
Interesting question.
Having lots of redirects will slow down your site.
There are different ways to implement your redirects other than .htaccess but I believe this would be the best method for you.
Is there any way you can group some of the redirects? maybe part of the URL is the same for all the pages you want to send to a certain folder then the match may work?
If not then I think you have a massive job on to redirect 5k pages and manage the redirects afterwards as well.
I would look at the pages and judge the value of a redirect on that page. If the page has no external links pointing to it and it has a low PA then do you need to redirect it?
You also need to keep in mind a few other things:
1. You need to make sure that the page you are redirecting to and from are similar in a boolean context - that is that a machine will see them as the same content and not just a person
2. you need to avoid redirect chains - that is a redirect to a redirect and so on
3. If you have redirects in place at the moment from HTTP to https you need to redirect these separately otherwise you will generate a chain
4. I would amend all your internal links rather than relying on the redirect otherwise again you will create a chain
Once you have implemented the redirects you will need to monitor them to see how much traffic they are generating, if after a few months a redirect is generating no traffic and all the traffic is going to the new URL then you will need to consider the benefit of keeping that redirect in place or removing it to improve site load times.
I hope this helps,
Steve
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
-
Solve Redirect Chains
I've gotten a few Redirect Issues that involve Redirect Chains, with the https:// version redirecting to the www. version and then redirecting to the right URL. Here is an example:
On-Page Optimization | | Billywig
Schermafbeelding 2021-12-07 om 11.04.32.png I've tried setting a direct redirect between the first and the last URL, but WordPress doesn't seem to allow that (it's overwritten). I've also tried checking the internal links to make sure that none of the links are the first one. They don't seem to be there. Does anyone have any tips on solving these Redirect Chains?0 -
Will Google Count Links Loaded from JavaScript Files After the Page Loads
Hi, I have a simple question. If I want to put an image with a link to another site like a banner ad on my page, but do not want it counted by Google. Can I simply load the link and banner using jQuery onload from a separate .js file? The ideal result would be for Google to index a script tag instead of a link.
On-Page Optimization | | CopBlaster.com1 -
How To Avoid Redirect Chains When Switching From http to https
I have been working on on-page SEO which has involved switching from http to https, and renaming URLs. I am running in to issues with redirect chains. Here is a scenario: Old URL: http://bwisecontractors.ca/products/decks-and-deck-covers/ New URL: https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ Since I already created the redirect addressing the redirecting from http to https for the root domain: (http://bwisecontractors.ca to https://bwisecontractors.ca), should the redirect for the above be http://bwisecontractors.ca/products/decks-and-deck-covers/ to https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ , or should it be http://bwisecontractors.ca/products/decks-and-deck-covers/ to http://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ (and the root domain redirect will take care of going from http to https)
On-Page Optimization | | BWiseContractors0 -
301 vs 410
Hello everyone! I'm going through a large list of old 404 links that search console has given me and a lot of these links need to be 301'd. My question is, should I 410 some of these links if I can't find a good place to 301 to? Or is there another thing I should do that is better practice. Thanks!
On-Page Optimization | | KathleenDC0 -
How to 301 redirect, without access to .htaccess and to a new domain
There are few ways to do this and I would like to ask other Mozzers if they have found the best way. We have a site .co.uk and are moving it back to .com. However we do not have any access to the site folders for .co.uk. (We have to move it anyway as our provider is withdrawing their service). We have built our URL 301 redirect file and it is ready to go, but how to impliment it? We can repoint .co.uk to another site, and then redirect all traffic for each URL but this is quite messy, or just forget trying to 301 each page and just rediect the whole site.
On-Page Optimization | | BruceA
the .com has more authority already, but we ready do not want to frustrate visitors who are using a link to reach a product, only to find they hit our homepage and not the product. Your thoughts would be very welcome or other ideas Bruce0 -
Using keywords in my URL: Doing a redirect to /keyword
My website in "On Page Grade" received an A.Anyway, I only have 1 thing to optimize:_"Use Keywords in your URL__Using your targeted keywords in the URL string adds relevancy to your page for search engine rankings, assists potential visitors identify the topic of your page from the URL, and provides SEO value when used as the anchor text of referring links."_My website is ranking in top10 for a super high competitive keyword and all my others competitors have the keyword on their domain, but not for my URL.Since I can't change my domain for fixing this suggestion, I would like to know what do you think about doing a 301 redirect from / to mydomainname.com/keyword/So the index of my website would be the /keyword.I don't know if this can make a damage to my SERP for the big change ir it would be a great choice.
On-Page Optimization | | estebanseo0 -
Author Byline Question
What's the best practice for displaying author information at the beginning of an article? We're presently displaying it as: By <Author> • Jan 16, 2015 • <City>. We're considering making it even more concise by removing the term 'By'. Would be shooting ourselves in the foot if we did this? Any other ways we should optimize?
On-Page Optimization | | TheaterMania0 -
301 redirect (www.domain.com/index to www.domain.com)
Hello, Please let me know what are the exact right steps in order to get rid of the duplicate content issues related with: www.domain.com/index.html same as www.domain.com without creating an infinite loop. Do you have a step by step guide posted within seomoz including 301 redirect for non www to www for all urls and index.whatever to main domain name without going into a infinite loop ? btw how to you spot the loop ? is it obvious like never ending refresh of the home page ? thanks a lot !
On-Page Optimization | | eyepaq2