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
-
Best SEO for table in mobile view
I'm wondering what the best way to present a table for mobile view in terms of SEO? It's a complicated table (not simple rows & columns but also col spans) which doesn't work with any responsive techniques I can find. I can offer different content for desktop / mobile so desktop is OK. But what's the best way forward with Google for mobile? I could offer a jpg or simply an explanation to revisit the page on desktop, but neither of those options seem particularly Google-friendly?
Intermediate & Advanced SEO | | Ann640 -
Hundreds of 301 Redirects. Remove Pages or Not?
Hi Mozers, I have a website that has literally got hundreds of 301 redirects. I had a close look at these URLs and only some of them have backlinks to it and remaining all of them are not indexing in Google and has got not backlinks at all. Based on what I have noticed experts mentioning, loads of 301 redirects can potentially slow down the site speed. In a case like the website I have, should I completely take off the pages from website to reduce the number of 301 redirects or should I leave 301 redirects? There is no traffic or backlinks coming from these URLs. Malika
Intermediate & Advanced SEO | | Malika10 -
Order and multiple match when 301 redirect ?
Hi, I'm migrating a single domain to a multiple domain for each language, using apache redirections: Redirect 301 /partners http://www.itris-automation.com/
Intermediate & Advanced SEO | | 2MSens
Redirect 301 /partner-si http://www.itris-automation.com/system-integrators-partners
Redirect 301 /partner-institute http://www.itris-automation.com/institutional-partners
Redirect 301 /fr/ http://www.itris-automation.fr/
Redirect 301 /fr/support http://www.itris-automation.fr/support
Redirect 301 /privacy?lang=fr http://www.itris-automation.fr/politique-de-confidentialite Redirect 301 /de/plc-converter http://www.itris-automation.de/plc-converter
Redirect 301 /de/services http://www.itris-automation.de/
Redirect 301 /de/plc-quality http://www.itris-automation.de/sps-qualitat .... However it doesn't work properly: For example automationsquare.com/privacy?lang=fr redirect to http://www.itris-automation.com/privacy instead of http://www.itris-automation.fr/politique-de-confidentialite Does the order of the redirect has an influence? Am I missing something? I've seen that the command [L] can be useful to avoid mismatch? Thanks, Best, Benoit.0 -
Local and Organic Listings
Hi, My client has a number of stores across the country (UK) and ideally I would like them to appear in both the local and organic listings - at the moment I appear more often than not on page one for one or the other - I have noticed however that some pages appear in both. I understand that Google will not place a listing for the same page in both local and organic so I need to optimise a page on the site for organic and point my local listing to a different page (home page?). On some results though I am seeing my local result appearing with the home page URL listed but the actual link points to the internal store page which is the same page that is appearing in the organic listing (both on page one). Other local listings of mine appear with the store page URL showing in the result. I haven't set anything up differently for these stores. Can anyone explain why this is happening? Thanks, Dan
Intermediate & Advanced SEO | | SEOBirmingham810 -
301 redirect subdomain to path and 301 for popular pages
We have very popular pages that have many backlinks. www.chezmaya.com/jeux/game33.htm have so many backlinks and it's very popular. Now If i'm moving this page to a new path like : http://www.chezmaya.com/jeux/component/mtree/Défouloir/Game33/details.html with a 301. Your SEOmoz toolbar is now giving a very low PA:1 and mR:0.00 for this new page. My question is after you crawl my site again would you change the values to what /jeux/game33.htm got before ? We used to have jeux.chezmaya.com and moved to www.chezmaya.com/jeux/
Intermediate & Advanced SEO | | SocialGeekMedia
Same here PA:1 and mR:0.00 for this page. Also Matt Cutts say that Google does transfer the juice from the old page to the new one. I already saw one url changed in a search for puzzle, it's at the same position it was before, but it say's 6 days ago beside. So I wonder if this is temporary and it will move with time? Thanks0 -
SEO Best practice for competitions
I am considering running a competition and wanted to get some feedback on SEO Best Practice. We will have a unique competition URL - following the completion of the competition it will be 301'd to home page Every entrant will be given a unique URL for the competition to share, if someone enters using there URL they get an extra ticket. This means we will create a large number of new unique URL's over a short period of time, the pages however will have the same content. Is this potentially bad for Duplicate content?Any advice? Perhaps a canonical tag on all unique competition entrant URLs? Any other considerations?
Intermediate & Advanced SEO | | RobertChapman0 -
301 Re-Directs Puzzling Question on Page Returned in Search Results
On our website, www.BusinessBroker.net, we have 3 different versions of essentially the same page for each of our State Business for Sale Pages. Back in August, we did a test and did 301 redirects using 5 States. For a long while after doing the redirects, the pages fell out of Google search results - we used to get page 1 rankings. Just recently they started popping back up on Page 1. However, I noticed that the new page meta data is not what is being picked up -- here is the example. Keyword Searched for in Google -- "Maine Business for Sale" Our listing shows up on Page 1 -- # 8 Result URL returned is correct preferred version: - http://www.businessbroker.net/state/maine-Businesses_For_Sale.aspx However, the Page Title on this returned page is still the OLD page title - OLD TITLE -- maine Business for Sale Ads - maine Businesses for Sale & Business Brokers - Sell a Business on Business Broker Not the title that is designated for this page - New Title - Maine Businesses for Sale - Buy or Sell a Business in ME | BusinessBroker.net Ditto for Meta Description. Why is this happening? Also have a problem with lower case showing up rather than upper case -- what's causing this? http://www.businessbroker.net/state/maine-Businesses_For_Sale.aspx versus -- http://www.businessbroker.net/State/Maine-Businesses_For_Sale.aspx Any help would be appreciated. Thanks, MM
Intermediate & Advanced SEO | | MWM37720 -
Regarding 301 Redirect!
Hello, I heard that 301 redirect can be good for newly registered domain names can i buy a old domain name and put 301 redirect on it to my newly registered niche market domain name. Shall i buy only 1 domain name and put 301 redirect to my newly registered domain names or i can do this for more than 1 old domains i purchased?
Intermediate & Advanced SEO | | anand20100