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
-
What is the safest way to redirect for best SEO benefits?
What is the safest way to redirect for best SEO benefits? Example: loodgieter-aanhuis.nl -> loodgieters-ambacht.nl Does someone have any technical information on how to (root) redirect for best SEO practices?
On-Page Optimization | | hans-keeren0 -
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 -
Image File Names for eCommerce?
Hi everyone! I'm wondering about naming my product photo file names for an E-Commerce site. Let's say I say have product named Abe Lincoln in the **Print **category for sale with 4 images, relatively similar but from different views for example.Could I name them as follows? 1) abe-lincoln-print.jpg 2) abe-lincoln-print-side-view.jpg 3) abe-lincoln-print-close-up.jpg 4) abe-lincoln-print-font-view.jpg Or is that too many keywords for the page? Should I be worried about keyword stuffing? Plus once I add in title and alt tags and descriptions this could also increase the keyword count for "abe lincoln print"?
On-Page Optimization | | TheFlyingSweetPotato0 -
How important are image file names
Hi, How important do you think the image file names are for image search?
On-Page Optimization | | jjtech
I know it used to be the best practice a while ago but is it still important? Thanks in advance, JJ0 -
301 Redirect to product page or category?
We manage an ecommerce website that sells health products. A few products have now been discontinued. I’m just wondering what would be the best practice in this case. Should we 301 redirect to a similar product or to a similar category page? ANY HELP IS GREATLY APPRECIATED!
On-Page Optimization | | odegi0 -
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 -
Image Optimization - File Name Important?
I am currently working on a site with 100+ recipes that all have image file names that are relevant, but not optimized for keyword purposes. I'm wondering - from an SEO perspective - would it be worth my time to go back through all of the images and rename them with keywords in mind? On my own site I have always done this as a "best practice" but I'm curious - does it make a difference to search engines? Does anyone have any recent research/experiences that they would like to share? Thanks!
On-Page Optimization | | EssEEmily0