What are the best strategies to organize a htaccess full of 301 re-directs
-
I have a client with a htaccess file that is a total mess!
What are the best practices to organize all the re-directs, and make it more manageable in the future.
Any resources would be appreciated.
-
Do you have root access to the server? If you do then a rewrite map is a lot faster then a bunch of rewrite rules & conditions.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritemap
You can always just add comments with the hash tag: # what each thing does and group them. That would be cleaner.
-
We have a site that is categorized by folder so we place separate .htaccess files in each folder... that keeps them relatively small instead of placing all of redirects in the root.
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
-
301 process, migration to new domain
Hi all! We have an old site wordpress based, with great ranking and PR 7, called www.europe-internship.com which is going to be migrated into our new Django site www.eurasmus.com (specifically eurasmus.com/en/europe-internships)
Intermediate & Advanced SEO | | Eurasmus.com
The new one is a much more advanced version that we will keep developing. We have been migrating the information already but we are planning to apply the 301s in the next weeks to start passing the SEO value to our new site and traffic. We have all the url structures and everything checked and technically we are ready for it.
Therefore, we are almost ready. I have 2 questions: The new site includes more services, like accommodation, information...not only internships. Therefore, should we point the most relevant urls from our previous site to our home to share the value or just to the internships section? I am afraid that if the bounce rate goes higher from the 301 we could loose some value... 2)Should we point all the urls at the same time to the new site? Home, vacancies, blog pages, etc... or start gradually doing it to see how it goes till we make it to all the pages including the home? The old site still makes some money and I am not sure how quick will be to pass the SEO value, so in the way we may loose few thousand euros...We understand that, but we want to check what would be the best in your opinion. Let me know what you think and your opinion! Thank you in advance!0 -
Geoip redirection, 301 or 302?
Hello all Let me first try to explain what our company does and what it is trying to achieve. Our company has an online store, sells products for 3 different countries, and two languages for each country. Currently we have one site, which is open to all countries, what we are trying to achieve is make 3 different stores for these 3 different countries, so we can have a better control over the prices in each country. We are going to use Geoip to redirect the user to the local store in his country. The suggested new structure is to add sub-folders as following: www.example.com/ca-en
Intermediate & Advanced SEO | | ajarad
www.example.com/ca-fr
www.example.com/us-en
... If a visitor is located outside these 3 countries, then she'll be redirected to the root directory www.example.com/en We can't offer to expand our SEO team to optimize new pages for the local market, it's not the priority for now, the main objective now is to be able to control the prices for different market. so to eliminate the duplicate issue, we'll use canonical tags. Now knowing our objective from the new URL structure, I have two questions: 1- which redirect should we use? 301, 302?
If we choose 301, then which version of the site will get the link juice? (i.e, /ca-en or /us-en?)
if we choose 302, then will the link juice remain in the original links? is it healthy to use 302 for long term redirections? 2- Knowing that Google bots comes from US-IP, does that mean that the other versions of the site won't be crawled (i.e, www.example.com/ca-fr), this is especially important for us as we are using AdWords, and unindexed pages will effect our quality score badly. I'd like to know if you have other account structure in your mind that would be better than this proposed structure. Your help is highly highly appreciated.
Thanks in advance.0 -
What if a 301 redirect is removed?
Suppose the following scenarios after a 301 redirects from source URL to targent URL is removed. 1. If source URL raises a 404 error, will target URL retained the link juice previously passed from source URL? 2. If source URL starts to show different content than what is showing on target URL, will the previously passed link juice be credited back to the source URL?
Intermediate & Advanced SEO | | Bull1350 -
301 Redirecting an Entire Site
I have a question which has had me thinking for hours..... If SITE A is ranking well on a number of search phrases and you 301 that site to another (SITE B). The site will change on the Google SERPs to the site which you've re-directed to... In this case SITE B. But how do you maintain the rankings of SITE A?. Do you keep the rankings of SITE A forever? Or will your rankings of SITE A (now SITE B) gradually slip as other sites rank higher? As you can no longer edit SITE A does Google take into consideration the content on SITE B and no longer take anything that SITE A had to offer into consideration? SITE B has simply replaced it in the SERPs??...... Please can anybody help? Thanks,
Intermediate & Advanced SEO | | karl620 -
How to 301 redirect all URLs with /? in?
I want to redirect all URLs that have /? in it. Indexed in Google is a bunch of urls lik: mysite.com/?674764 mysite.com/?rtf8y78 I want all these URLs to be redirected to my home page. Any ideas?
Intermediate & Advanced SEO | | JohnPeters0 -
Reverse Proxy better than 301 redirect?
Are reverse proxies that much better than 301 redirects? Should I invest the time in doing this? I found out about reverse proxies here: http://www.seomoz.org/blog/what-is-a-reverse-proxy-and-how-can-it-help-my-seo
Intermediate & Advanced SEO | | brianmcc0 -
When is it worth re-structuring your site?
I recently started working on a site that is 8 years old and the currently URLs/ site structure is not SEO friendly. We are concerned that in re-structuring the site, we may loose our rankings. Has anyone ever completely re-structured their site? Was it worth it?
Intermediate & Advanced SEO | | nicole.healthline0 -
Don't want to lose page rank, what's the best way to restructure a url other than a 301 redirect?
Currently in the process of redesigning a site. What i want to know, is what is the best way for me to restructure the url w/out it losing its value (page rank) other than a 301 redirect?
Intermediate & Advanced SEO | | marig0