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
-
Full title in url
Hi to all, what is the best url structure, to have all words in the url or to tweak url like Yoast suggest? If we remove some words from url , not focus keyword but stop words and other keywords to have shorter url will that impact search rankings? example.com/one-because-two-for-three-on-four - long url, moz crawl error, yoast red light example.com/one-two-three-four - moz ok, yoast ok Where one is a focus keyword.
Intermediate & Advanced SEO | | WalterHalicki0 -
Do links to a domain that re-directs to my domain pass link equity?
Hi guys. We've recently taken control of a third-party site and we're going to set up a domain re-direct so any traffic comes to our site. With any existing links that the third-party site has, will these pass link equity to our main site through the redirect? Thanks, Paul
Intermediate & Advanced SEO | | kevinliao0 -
301 page into a 404
Hi I have a job board site and the way the site is built means that I cant 404 job pages once they have expired. To combat this Im looking to 301 the pages into a 404 page.Do any of you have any experience with this? Are there any potential pitfalls to doing a 404 this way? Thanks
Intermediate & Advanced SEO | | AndrewAkesson0 -
Is there anything wrong with this 301 redirect?
I'll keep this one short and sweet 🙂 Many moons ago we used to have several different methods of sorting our products and this change in sort order was achieved by having ?dispmode=list or ?dispmode=grid after the product URL. Best part of a year ago we decided to scrap this feature and 301'd all the ?dispmode URL's back to the base URL. The funny thing is that Google don't seem to have dropped a single one of the old URL's from their index and a search for site:www.refreshcartridges.co.uk dispmode returns almost 8,000 results. This isn't a massive problem but I'd have expected in the past year they'd have picked up on a couple of the 301's and would have started removing the old results. I'd hate to think we were getting any kind of penalisation for duplicate pages. I know the answer to this question is going to be 'just be patient, the old results will disappear' but just to ensure we're not missing anything stupid. I'd really appreciate it if someone could check out www.refreshcartridges.co.uk/brother-c-223.html?dispmode=list to confirm there's nothing more we could be doing to get these old results removed from the index. Many thanks
Intermediate & Advanced SEO | | ChrisHolgate0 -
Help Needed With .htaccess RewriteRule
Hello Fellow Mozzers, I would really appreciate a little help as I have been banging my head against a wall for the last few hours trying to create a .htaccess RewriteRule. I have around 300 URLs that I need to 301 redirect following a site re-build, they are in groups of similar urls but infortunately not broken down in to folders. Here is an example of a few URLs:- https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii_2.htm
Intermediate & Advanced SEO | | AdeLewis
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii-200225cm-6670.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoodii.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-ellwoods-gold.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-lemon-queen.htm
https://www.domain.co.uk/chamaecyparis-lawsoniana-yvonne-200cm-66.htm All of the above URLs need to redirect to a new URL:- http://www.domain.co.uk/chamaecyparis-lawsoniana Here is the RewriteRule that I currently have but it isn't working:- RewriteEngine On
RewriteRule ^(.*)_chamaecyparis-lawsoniana$ https://www.domain.co.uk/chamaecyparis-lawsoniana [R=301,L] Anyone have any suggestions? Thanks
Ade.0 -
Duplicate content even with 301 redirects
I know this isn't a developer forum but I figure someone will know the answer to this. My site is http://www.stadriemblems.com and I have a 301 redirect in my .htaccess file to redirect all non-www to www and it works great. But SEOmoz seems to think this doesn't apply to my blog, which is located at http://www.stadriemblems.com/blog It doesn't seem to make sense that I'd need to place code in every .htaccess file of every sub-folder. If I do, what code can I use? The weirdest part about this is that the redirecting works just fine; it's just SEOmoz's crawler that doesn't seem to be with the program here. Does this happen to you?
Intermediate & Advanced SEO | | UnderRugSwept0 -
Which is best structure for Multiple XML Sitemap?
I have read such a great blog posts on Multiple XML Sitemaps on following websites before a week. SEOmoz Distilled Google Webmaster Central Blog Search Engine Land SEO Inc I have created multiple XML sitemaps for my eCommerce website with following structure and submitted to Google webmaster tools. http://www.vistastores.com/main_sitemap.xml http://www.vistastores.com/products_sitemap.xml But, I am not satisfy with my second XML sitemap because it contain more than 7K+ product page URLs and looks like very slow crawling by Google! I want to separate my XML sitemap with following structure. With Root Level Category http://www.vistastores.com/outdoor_sitemap.xml http://www.vistastores.com/furniture_sitemap.xml http://www.vistastores.com/kitchen_dining_sitemap.xml http://www.vistastores.com/home_decor_sitemap.xml OR::: End Level Category http://www.vistastores.com/table_lamps_sitemap.xml http://www.vistastores.com/floor_lamps_sitemap.xml . . . . . . . etc.... So, Which is best structure for Multiple XML Sitemap?
Intermediate & Advanced SEO | | CommercePundit0 -
Is there a FastTrack to re-index? a site?
Hello... i just started with a new client this week, before working with us his last domain-hosting-webdev provider cancel their account and took off the entire site and left them with a nice "under construction page" (NOT) and added the noindex, nofollow tags. 4 weeks after that, we come into the scene and of course our client it's expecting us to reinsert at least for branded terms the site, and he wants it done on a matter of hours... I tried my best to explain that it's not possible and we are doing everything we can't.... now i ask you guys.. I already created de GWT account, Created a well structured Sitemap and submitted it to google and bing, did the onpage optimizitation at least the basics... there is a way to speed up the process? kind of like "hey you! google bot, forget about the noindex nonsense a come crawl again?" Any help would be great Daniel
Intermediate & Advanced SEO | | daniel.alvarez0