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
-
SEO and auto login with redirect
Hi, we have a site where user we know (cookie-based) is automatic redirected to private internal page. Unknown guests are staying on the page google search sent them. The redirect is done with a 302 to the private page. When I examine organic search and landing pages in analytics I see that more than 50% of the landing pages are private pages (inaccessible for the google-bot). This is because analytics does not register the redirecting page, just the target page. Is this harmful to SEO that so many users are redirected to other pages, or is this data not available to google-bot. The google bots is not redirect since they do not have the correct credentials. Do chrome or analytics send such data back to Google search? Is better to manipulate analytics page track call to use the address of the redirecting page? Or maybe skip to redirect, and just render the private content on the orginal page?
On-Page Optimization | | Morten.Berg0 -
Another anchor text question
Hi, We are updating a site and creating new separate pages for each coworker (app. 50 coworkers). Each page will include picture, short description, cv and also a subtitle/"keyword list" called: "areas of expertise". Each keyword (area of expertise) has it´s own in depth page on the subject, would it be wise to anchor text -link these? or is this something that is likely to be picked up by google as spam? Thanks!
On-Page Optimization | | Agguk
/Anders0 -
SERP Hijacking/Content Theft/ 302 Redirect?
Sorry for the second post, thought this should have it's own. Here is the problem I am facing amongst many others. Let's take the search term "Air Jordan Release Dates 2017" and place it into Google Search. Here is a link:
On-Page Optimization | | SneakerFiles
https://www.google.com/#q=air+jordan+release+dates+2017 Towards the bottom of the page, you will see a website that has SneakerFiles (my website) in the title. The exact title is: Air Jordan Release Dates 2016, 2017 | SneakerFiles - Osce Now, this is my content, but not my website. For some reason, Google thinks this is my site. If you click on the link in search, it automatically redirects you to another page (maybe 302 redirect), but in the cache you can see it's mine:
http://webcache.googleusercontent.com/search?q=cache:qrVEUDE1t48J:www.osce.gob.pe/take_p_firm.asp%3F+&cd=8&hl=en&ct=clnk&gl=us I have blocked the websites IP, disallowed my style.css to be used so it just shows a links without the style, still nothing. I have submitted multiple google spam reports as well as feedback from search. At times, my page will return to the search but it gets replaced by this website. I even filed a DMCA with Google, they declined it. I reached out to their Host and Domain register multiple times, never got a response. The sad part about this, it's happening for other keywords, for example if you search "KD 9 Colorways", the first result is for my website but on another domain name (my website does rank 3rd for a different Tag page). The page I worked hard on keeping up to date. I did notice this bit of javascript from the cloaked/hacked/serp hijacking website: I disabled iFrames...(think this helps) so not sure how they are doing this. Any help would be greatly appreciated. Note: I am using Wordpress if that means anything.0 -
Two Robots.txt files
Hi there Can somebody please help me that one of my client site have two robot.txt files (please see below). One txt file is blocked few folders and another one is blocked completely all the Search engines. Our tech team telling that due to some technical reasons they using second one which placed in inside the server and search engines unable to see this file. www.example.co.uk/robots.txt - Blocked few folderswww.example.co.uk/Robots.txt - Blocked all Search Engines I hope someone can give me the help I need in this one. Thanks in advance! Cheers,
On-Page Optimization | | TrulyTravel
Satla0 -
Our urls for adwords are slightly different from current urls presented on site (weused htaccess to help create shorter urls). How important is it that the adwords url match the sitemap url for keywords on those pages?
Hello, We have dynamic urls that we have made into short urls through htaccess and code manipulation. Some of our adwords urls are different from our page urls - for example a) Latest version of page www.abc.com/x-y-z.html b) Previous version of url www.abc.com/x+y+z.html c) raw original version www.abc.com/yyy/zzz?category=X&Product-code=Y etc etc. Would my ranking for keywords on the page improve if I diligently made all of them the same? They all go to the same page even now, and no 404 errors or anything. Thanks Sam
On-Page Optimization | | samgold0 -
301 vs 302 redirect
Hello Mozers, I have a website which offers subscriptions on a monthly basis, when one profile expires the link of the profile gets a 301 redirect to the main category, just that if the member chooses to come back after a while he can reactivate the profile and the link will work again and the 301 will disappear, Should I be doing 302 redirect, as from this point of view it's only a temporarily redirect ? Thanks in advance
On-Page Optimization | | asmedia0 -
301 redirects, efficiency and dynamic URLs
Hi, I have 2 301 redirect questions. Question 1: I have am working with a designer on the redesign of a website that currently has over 5,000 indexed pages. The majority of these are dynamic URLs from the Stone Locator database. (see below) http://www.domain.com/storelocator.php?zipcode=91784&page=12 How can I efficiently deal with these pages from an SEO perspective when developing the new site? Is there a way to do a bulk 301 redirect to a store locator page, for instance? Question 2: If a rel=canonical tag has been established on a page (www....), is it necessary to add 301 redirects to all of the other versions on: the home page (domain.com , domain.com/index.html, domain.com/index.html, etc.) all other pages with those same extensions ? Thank you for your help! Erin
On-Page Optimization | | HiddenPeak0 -
Best way to do a 301 redirect when the incorrect page has rank and FB likes
Due to a site structural problem with our CMS we have alot of duplicate content pages (1 page, with multiple urls). We are in the process of setting up 301 redirects to correct the problem. Meanwhile; one of the pages with the "incorrect" URL happens to be the page google favors and also has about 100 FB "likes". The question is: Are we better off keeping the "incorrect" URL for that particular page and redirect the other url to it? Both have a page rank of 3. Thanks
On-Page Optimization | | foodsleuth0