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
-
Keyword Stuffing Question
Say your on a e-commerce category page "Shirts" every lower level category has "shirts" in it such as: T-shirt, long sleeve shirt, sweat shirt, v-neck shirt, and so on. Is this page going to be penalized in google for the keyword "shirts" just because it is in the title and on the page a thousand times because i'm targetting words like "long sleeve shirt? and if it is, will the "long sleeve shirt" keyword be negatively affected as well? Answer much appreciated,
On-Page Optimization | | Mike.Bean
Thanks in advance.0 -
301 to canonical
I'm doing some work on a website, they have a very popular product search where you enter a specific part code (6 digits) and it takes you to the product. So for example Search: 123456 Page redirected to domain.com/product/123456 With a canonical of domain.com/product/this-is-the-product-title Would it be beneficial to redirect from /product/123456 to /product/this-is-the-product-title Google seems to be indexing both versions. For some of these products a reasonable amount of links are built.
On-Page Optimization | | ThomasHarvey0 -
Should you 301, 302, or rel=canonical private pages?
What should you do with private 'logged in' pages from a seo perspective? They're not visible to crawlers and shouldn't be indexed, so what is best practice? Believe it or not, we have found quite a few back links to private pages and want to get the ranking benefit from them without them being indexed. Eg: http://twiends.com/settings (Only logged in user can see the page) 302 them: We can redirect users/crawlers temporarily, but I believe this is not ideal from a seo perspective? Do we lose the link juice to this page? 301 them: We can do a permanent redirect with a short cache time. We preserve most link juice now, but we probably mess up the users browser. Users trying to reach a private page while logged out may have issues reaching it after logged in. **Serve another page with rel=canonical tag: **We could serve back the home page without changing the URL. We use a canonical tag to tell the crawlers that it's a duplicate of the home page. We keep most of the link juice, and the browser is unaffected. Yes, a user might share that different URL now, but its unlikely. We've been doing 302's up until now, now we're testing the third option. How do others solve this problem? Is there a problem with it? Any advice appreciated.
On-Page Optimization | | dsumter0 -
Titling and H1 Tag Question
What to do if you have hundreds of thousands of a particular product. Comic Books for example. Is it ok to have the words Comic Book in the title and H1 tag as long as it is qualified? For example, if I have the following as both the Title tag and the H1 tag. Comic Book - Spider Man Versus Wolverine Comic Book - Silver Surfer Goes Home to Visit Mom. Comic Book - Superman Gets a New Kitten Comic Book - Wonder Woman is More Wonderful Than You Know As of now, I have been doing it this way, but only in the title tag. However, Google has been using my H1 tag as my title, so in the search results, I am only getting: "Superman Gets a New Kitten" And I am afraid that that is leaving out important info for searchers, especially qualifying that the product is a Comic Book and if someone is searching for a Comic Book, I need that to return. But I don't want any 'more' trouble from the Panda. Again, this will be hundreds of thousands of products. Thanks for your help! Craig
On-Page Optimization | | TheCraig0 -
Internal Linking : File Name or URI/filename.html
Hi, For crawlability, what would be the best way to do internal linking. /aboutus.html or www.xyz.com/aboutus.com Would this make any difference to the website in terms of SEO or bot crawling the website? Regards, Sree
On-Page Optimization | | jungleegames0 -
URL question
When we type in the URL of www.JustBunkBeds.com on firefox we end up with (S) in URL https://www.justbunkbeds.com/ When we type in the URL of www.JustBunkBeds.com on Explorer we end up with http://www.justbunkbeds.com/ Appreciate answer to this question Tony
On-Page Optimization | | OCFurniture0 -
Redirect a blog category page to the homepage?
Hi folks Following Penguin 1.1, I have a client site at number 5 for their primary keyword. (was creeping up page 2 with whitehat link building and tight on-site SEO.) However now the page ranking at No. 5 is for a blog category archive. What do people think the quickest / safest way to get this ranking directed back to the homepage is? Many thanks Simon
On-Page Optimization | | SCL-SEO0 -
301 redirects from several sub-pages to one sub-page
Hi! I have 14 sub-pages i deleted earlier today. But ofcourse Google can still find them, and gives everyone that gives them a go a 404 error. I have come to the understading that this wil hurt the rest of my site, at least as long as Google have them indexed. These sub-pages lies in 3 different folders, and i want to redirect them to a sub-page in a folder number 4. I have already an htaccess file, but i just simply cant get it to work! It is the same file as i use for redirecting trafic from mydomain.no to www.mydomain.no, and i have tried every kind of variation i can think of with the sub-pages. Has anyone perhaps had the same problem before, or for any other reason has the solution, and can help me with how to compose the htaccess file? 🙂 You have to excuse me if i'm using the wrong terms, missing something i should have seen under water while wearing a blindfold, or i am misspelling anything. I am neither very experienced with anything surrounding seo or anything else that has with internet to do, nor am i from an englishspeaking country. Hope someone here can light up my path 🙂 Thats at least something you can say in norwegian...
On-Page Optimization | | MarieA1