Skip to content
    Moz logo Menu open Menu close
    • Products
      • Moz Pro
      • Moz Pro Home
      • Moz Local
      • Moz Local Home
      • STAT
      • Moz API
      • Moz API Home
      • Compare SEO Products
      • Moz Data
    • Free SEO Tools
      • Domain Analysis
      • Keyword Explorer
      • Link Explorer
      • Competitive Research
      • MozBar
      • More Free SEO Tools
    • Learn SEO
      • Beginner's Guide to SEO
      • SEO Learning Center
      • Moz Academy
      • SEO Q&A
      • Webinars, Whitepapers, & Guides
    • Blog
    • Why Moz
      • Agency Solutions
      • Enterprise Solutions
      • Small Business Solutions
      • Case Studies
      • The Moz Story
      • New Releases
    • Log in
    • Log out
    • Products
      • Moz Pro

        Your all-in-one suite of SEO essentials.

      • Moz Local

        Raise your local SEO visibility with complete local SEO management.

      • STAT

        SERP tracking and analytics for enterprise SEO experts.

      • Moz API

        Power your SEO with our index of over 44 trillion links.

      • Compare SEO Products

        See which Moz SEO solution best meets your business needs.

      • Moz Data

        Power your SEO strategy & AI models with custom data solutions.

      NEW Keyword Suggestions by Topic
      Moz Pro

      NEW Keyword Suggestions by Topic

      Learn more
    • Free SEO Tools
      • Domain Analysis

        Get top competitive SEO metrics like DA, top pages and more.

      • Keyword Explorer

        Find traffic-driving keywords with our 1.25 billion+ keyword index.

      • Link Explorer

        Explore over 40 trillion links for powerful backlink data.

      • Competitive Research

        Uncover valuable insights on your organic search competitors.

      • MozBar

        See top SEO metrics for free as you browse the web.

      • More Free SEO Tools

        Explore all the free SEO tools Moz has to offer.

      What is your Brand Authority?
      Moz

      What is your Brand Authority?

      Check yours now
    • Learn SEO
      • Beginner's Guide to SEO

        The #1 most popular introduction to SEO, trusted by millions.

      • SEO Learning Center

        Broaden your knowledge with SEO resources for all skill levels.

      • On-Demand Webinars

        Learn modern SEO best practices from industry experts.

      • How-To Guides

        Step-by-step guides to search success from the authority on SEO.

      • Moz Academy

        Upskill and get certified with on-demand courses & certifications.

      • SEO Q&A

        Insights & discussions from an SEO community of 500,000+.

      Unlock flexible pricing & new endpoints
      Moz API

      Unlock flexible pricing & new endpoints

      Find your plan
    • Blog
    • Why Moz
      • Small Business Solutions

        Uncover insights to make smarter marketing decisions in less time.

      • Agency Solutions

        Earn & keep valuable clients with unparalleled data & insights.

      • Enterprise Solutions

        Gain a competitive edge in the ever-changing world of search.

      • The Moz Story

        Moz was the first & remains the most trusted SEO company.

      • Case Studies

        Explore how Moz drives ROI with a proven track record of success.

      • New Releases

        Get the scoop on the latest and greatest from Moz.

      Surface actionable competitive intel
      New Feature

      Surface actionable competitive intel

      Learn More
    • Log in
      • Moz Pro
      • Moz Local
      • Moz Local Dashboard
      • Moz API
      • Moz API Dashboard
      • Moz Academy
    • Avatar
      • Moz Home
      • Notifications
      • Account & Billing
      • Manage Users
      • Community Profile
      • My Q&A
      • My Videos
      • Log Out

    The Moz Q&A Forum

    • Forum
    • Questions
    • Users
    • Ask the Community

    Welcome to the Q&A Forum

    Browse the forum for helpful insights and fresh discussions about all things SEO.

    1. Home
    2. SEO Tactics
    3. Intermediate & Advanced SEO
    4. Htaccess maximum size?

    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.

    Htaccess maximum size?

    Intermediate & Advanced SEO
    2
    2
    610
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as question
    Log in to reply
    This topic has been deleted. Only users with question management privileges can see it.
    • DPA
      DPA last edited by

      Hello all,

      The company that develops our website recently contacted and asked me if we could remove a large amount of URL rewrites. I've described a few factors and my main questions below.

      Some information:

      • One year ago we did a large migration. We went from 27 websites to one main website.
      • We have got about 2000 rewrites in the htaccess file. And the file is 208kb.
      • A lot of links from our old domains still have incoming traffic which are handled by the rewrite rules mentioned above.

      Questions:
      The company that develops our website said that the htaccess file is too large and is causing or could be causing us website performance issues. They have asked us to remove URL rewrites.
      My question is:
      a) How many rewrites is too much? 
      b) Is the filesize of the htaccess of any importance or is it just the amount of rewrites in the file?
      c) Could we solve any potential server/website performance issues due to a large htaccess file in any other way? Increasing some values like 'post_max_size' or by any other solutions handled serverside?

      I do not have a lot of knowledge of htaccess rules but I've seen websites that handled over a million of rewrite rules. This is why I'm having doubts on whether removing URL rewrites is the only solution and possibly not the best solution for us.

      Hopefully you can help me any further and with the best way to proceed without losing traffic or causing 404 pages.

      Thanks in advance!
      Iordache Voicu

      1 Reply Last reply Reply Quote 0
      • KevinBudzynski
        KevinBudzynski last edited by

        If you have access to the main server's configuration file, place there. Code in httpd.conf is compiled on server restart where .htaccess is interpreted on every http request. The best way of doing it.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post

        Got a burning SEO question?

        Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.


        Start my free trial


        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.

        • See all categories

        Related Questions

        • amberprata

          301 Redirects for Multiple Language Sites in htaccess File

          Hi everyone, I have a site  on a subdomain that has multiple languages set up at the domain level: https://mysite.site.com, https://mysite.site.fr ,  https://mysite.site.es , https://mysite.site.de , etc. We are migrating to a new subdomain and I am trying to create 301 redirects within the htaccess file, but I am a bit lost on how to do this as it seems you have to go from a relative url to an absolute - which would be fine if I was only doing this for the english site, but I'm not. It doesn't seem like I can go from absolute url to an absolute url - but I could be wrong. I am new to editing the htaccess file - so I could definitely use some advice here. Thanks.

          Intermediate & Advanced SEO | | amberprata
          0
        • smpomoryCRH

          How Can I Redirect an Old Domain to Our New Domain in .htaccess?

          There is an old version of http://chesapeakeregional.com still floating around the web here: http://www.dev3.com.php53-24.dfw1-2.websitetestlink.com/component/content/category/20-our-services. Various iterations of this domain pop up when I do certain site:searches and for some queries as well (such as "Diagnostic Center of Chesapeake"). About 3 months ago the websitetestlink site had files and a fully functional navigation but now it mostly returns 404 or 500 errors. I'd like to redirect the site to our newer site, but don't believe I can do that in chesapeakeregional.com's .htaccess file. Is that so and would I need access to the websitetestlink .htaccess to forward the domain? Note* I (nor anyone else in our organization) has the login for the old site. The new site went live about 9 months before I arrived at the organization and I've been slowly putting the pieces together since arriving.

          Intermediate & Advanced SEO | | smpomoryCRH
          0
        • FPK

          Hacked website - Dealing with 301 redirects and a large .htaccess file

          One of my client's websites was recently hacked and I've been dealing with the after effects of it. The website is now clean of malware and I already appealed to Google about the malware issue. The current issue I have is dealing with the 20, 000+ crawl errors which are garbage links that were created from the hacking. How does one go about dealing with all the 301 redirects I need to create for all the 404 crawl errors? I'm already noticing an increased load time on the website due to having a rather large .htaccess file with a couple thousand 301 redirects done already which I fear will result in my client's website performance and SEO performance taking a hit as well.

          Intermediate & Advanced SEO | | FPK
          0
        • NeatIT

          6 .htaccess Rewrites: Remove index.html, Remove .html, Force non-www, Force Trailing Slash

          i've to give some information about my website Environment 1. i have static webpage in the root. 2. Wordpress installed in sub-dictionary www.domain.com/blog/ 3. I have two .htaccess , one in the root and one in the wordpress
          folder. i want to www to non on all URLs Remove index.html from url Remove all .html extension / Re-direct 301 to url
          without .html extension Add trailing slash to the static webpages / Re-direct 301 from non-trailing slash Force trailing slash to the Wordpress Webpages / Re-direct 301 from non-trailing slash Some examples domain.tld/index.html >> domain.tld/ domain.tld/file.html >> domain.tld/file/ domain.tld/file.html/ >> domain.tld/file/ domain.tld/wordpress/post-name >> domain.tld/wordpress/post-name/ My code in ROOT htaccess is <ifmodule mod_rewrite.c="">Options +FollowSymLinks -MultiViews RewriteEngine On
          RewriteBase / #removing trailing slash
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^(.*)/$ $1 [R=301,L] #www to non
          RewriteCond %{HTTP_HOST} ^www.(([a-z0-9_]+.)?domain.com)$ [NC]
          RewriteRule .? http://%1%{REQUEST_URI} [R=301,L] #html
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^([^.]+)$ $1.html [NC,L] #index redirect
          RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index.html\ HTTP/
          RewriteRule ^index.html$ http://domain.com/ [R=301,L]
          RewriteCond %{THE_REQUEST} .html
          RewriteRule ^(.*).html$ /$1 [R=301,L]</ifmodule> The above code do 1. redirect www to non-www
          2. Remove trailing slash at the end (if exists)
          3. Remove index.html
          4. Remove all .html
          5. Redirect 301 to filename but doesn't add trailing slash at the end

          Intermediate & Advanced SEO | | NeatIT
          0
        • kimmiedawn

          Can an incorrect 301 redirect or .htaccess code cause 500 errors?

          Google Webmaster Tools is showing the following message: _Googlebot couldn't access the contents of this URL because the server had an internal error when trying to process the request. These errors tend to be with the server itself, not with the request.  _ Before I contact the person who manages the server and hosting (essentially asking if the error is on his end) is there a chance I could have created an issue with an incorrect 301 redirect or other code added to .htaccess incorrectly? Here is the 301 redirect code I am using in .htaccess: RewriteEngine On RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/.]+/)*(index.html|default.asp)\ HTTP/ RewriteRule ^(([^/.]+/)*)(index|default) http://www.example.com/$1 [R=301,L] RewriteCond %{HTTP_HOST} !^(www.example.com)?$ [NC] RewriteRule (.*) http://www.example.com/$1 [R=301,L] Could adding the following code after that in the .htaccess potentially cause any issues? BEGIN EXPIRES <ifmodule mod_expires.c="">ExpiresActive On
          ExpiresDefault "access plus 10 days"
          ExpiresByType text/css "access plus 1 week"
          ExpiresByType text/plain "access plus 1 month"
          ExpiresByType image/gif "access plus 1 month"
          ExpiresByType image/png "access plus 1 month"
          ExpiresByType image/jpeg "access plus 1 month"
          ExpiresByType application/x-javascript "access plus 1 month"
          ExpiresByType application/javascript "access plus 1 week"
          ExpiresByType application/x-icon "access plus 1 year"</ifmodule> END EXPIRES (Edit) I'd like to add that there is a Wordpress blog on the site too at www.example.com/blog with the following code in it's .htaccess: BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
          RewriteBase /blog/
          RewriteRule ^index.php$ - [L]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule . /blog/index.php [L]</ifmodule> END WordPress Thanks

          Intermediate & Advanced SEO | | kimmiedawn
          0
        • esiow2013

          May know what's the meaning of these parameters in .htaccess?

          Begin HackRepair.com Blacklist RewriteEngine on Abuse Agent Blocking RewriteCond %{HTTP_USER_AGENT} ^BlackWidow [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Bolt\ 0 [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Bot\ mailto:craftbot@yahoo.com [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} CazoodleBot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^ChinaClaw [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Custo [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Default\ Browser\ 0 [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^DIIbot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^DISCo [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} discobot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Download\ Demon [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^eCatch [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ecxi [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^EirGrabber [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^EmailCollector [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^EmailSiphon [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^EmailWolf [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Express\ WebPictures [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^ExtractorPro [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^EyeNetIE [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^FlashGet [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^GetRight [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^GetWeb! [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Go!Zilla [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Go-Ahead-Got-It [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^GrabNet [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Grafula [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} GT::WWW [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} heritrix [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^HMView [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} HTTP::Lite [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} HTTrack [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ia_archiver [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} IDBot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} id-search [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} id-search.org [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Image\ Stripper [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Image\ Sucker [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Indy\ Library [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^InterGET [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Internet\ Ninja [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^InternetSeer.com [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} IRLbot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ISC\ Systems\ iRc\ Search\ 2.1 [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Java [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^JetCar [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^JOC\ Web\ Spider [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^larbin [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^LeechFTP [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} libwww [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} libwww-perl [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Link [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} LinksManager.com_bot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} linkwalker [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} lwp-trivial [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Mass\ Downloader [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Maxthon$ [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} MFC_Tear_Sample [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^microsoft.url [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Microsoft\ URL\ Control [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^MIDown\ tool [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Mister\ PiX [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Missigua\ Locator [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Mozilla.*Indy [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Mozilla.NEWT [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^MSFrontPage [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Navroad [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^NearSite [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^NetAnts [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^NetSpider [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Net\ Vampire [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^NetZIP [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Nutch [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Octopus [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Offline\ Explorer [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Offline\ Navigator [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^PageGrabber [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} panscient.com [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Papa\ Foto [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^pavuk [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} PECL::HTTP [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^PeoplePal [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^pcBrowser [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} PHPCrawl [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} PleaseCrawl [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^psbot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^RealDownload [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^ReGet [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Rippers\ 0 [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} SBIder [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^SeaMonkey$ [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^sitecheck.internetseer.com [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^SiteSnagger [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^SmartDownload [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Snoopy [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Steeler [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^SuperBot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^SuperHTTP [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Surfbot [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^tAkeOut [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Teleport\ Pro [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Toata\ dragostea\ mea\ pentru\ diavola [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} URI::Fetch [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} urllib [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} User-Agent [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^VoidEYE [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Web\ Image\ Collector [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Web\ Sucker [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Web\ Sucker [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} webalta [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebAuto [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^[Ww]eb[Bb]andit [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} WebCollage [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebCopier [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebFetch [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebGo\ IS [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebLeacher [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebReaper [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebSauger [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Website\ eXtractor [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Website\ Quester [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebStripper [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebWhacker [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WebZIP [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} Wells\ Search\ II [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} WEP\ Search [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Wget [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Widow [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WWW-Mechanize [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^WWWOFFLE [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Xaldon\ WebSpider [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} zermelo [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^Zeus [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ^(.)Zeus.Webster [NC,OR]
          RewriteCond %{HTTP_USER_AGENT} ZyBorg [NC]
          RewriteRule ^. - [F,L] Abuse bot blocking rule end End HackRepair.com Blacklist

          Intermediate & Advanced SEO | | esiow2013
          1
        • Townpages

          .htaccess 301 Redirect Help! Specific Redirects and Blanket Rule

          Hi there, I have the following domains: OLD DOMAIN: domain1.co.uk NEW DOMAIN: domain2.co.uk I need to create a .htaccess file that 301 redirects specific, individual pages on domain1.co.uk to domain2.co.uk I've searched for hours to try and find a solution, but I can't find anything that will do what I need. The pages on domain1.co.uk are all kinds of filenames and extensions, but they will be redirected to a Wordpress website that has a clean folder structure. Some example URL's to be redirected from the old website: http://www.domain1.co.uk/charitypage.php?charity=357 http://www.domain1.co.uk/adopt.php http://www.domain1.co.uk/register/?type=2 These will need to be redirected to the following URL types on the new domain: http://www.domain2.co.uk/charities/ http://www.domain2.co.uk/adopt/ http://www.domain2.co.uk/register/ I would also like a blanket/catch-all redirect from anything else on www.domain1.co.uk to the homepage of www.domain2.co.uk if there isn't a specific individual redirect in place. I'm literally tearing my hair out with this, so any help would be greatly appreciated! Thanks

          Intermediate & Advanced SEO | | Townpages
          0
        • pepsimoz

          Htaccess Redirect with %C2%A0 in URL

          Below is my setup for redirects in .htaccess file in my root word press installation. The www to non-www works well, so no problems there Other page redirects work well, too (example: redirect 301 /some-page/ http://mysite.com/another-page/ (I didn't post those because I have a few too many : ) So here it goes... RewriteEngine On
          RewriteCond %{HTTP_HOST} ^www.mysite.com$ [NC]
          RewriteRule ^(.*)$ http://mysite.com/$1 [R=301,L] BEGIN WordPress <ifmodule mod_rewrite.c="">RewriteEngine On
          RewriteBase /
          RewriteRule ^index.php$ - [L]
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule . /index.php [L]</ifmodule> END WordPress redirect 301 /archives/10-college- majors/ http://mysite.com/archives/10-college-majors/ redirect 301 /archives/10-college-%20majors/ http://mysite.com/archives/10-college-majors/ redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/ I'm having a problem with the last 301 redirect: redirect 301 /archives/10-college-%C2%A0majors/ http://mysite.com/archives/10-college-majors/ not working... As you can see I've tried using other varations of the "space" but no go. I also used a redirect in cPanel's Redirect screen; testing all the possible options + wildcard I've also tried this: http://serverfault.com/questions/201829/using-special-characters-in-apache-mod-rewrite-rule (perhaps unsuccessfully, because it caused a 500 server error and it's a different situation in my case) I also saw something here: http://www.webmasterworld.com/apache/3908682.htm but I don't know if it works and how I would implement that + do so without compromising ALL other redirects. Note: the URL displays with a space in the address bar of all major web browsers: http://mysite.com/10-college- majors/  and goes to a 404 page I have a goregous page / PR6 / high authority site linking to the URL on my site, but they copied the URL with a space somehow. I contacted the person responsible for the website and he claims it works fine (aka he didn't check it). Is there a clean way to redirect ONLY this problematic URL without compromising other redirects, etc? Any ideas would be great. I'll respond with progress. Thanks in advance. UPDATE the   redirect works, and it did work. Even so, when looking at source of page linking to mine, the URL looks like this: ``` http://mysite.com/archives/10-college- majors/ Clicking the URL in Source View in FireFox takes me to ``` http://mysite.com/archives/10-college-%C2%A0majors/ none of my 301 redirects should direct there. I don't have any redirect plugins either.

          Intermediate & Advanced SEO | | pepsimoz
          0

        Get started with Moz Pro!

        Unlock the power of advanced SEO tools and data-driven insights.

        Start my free trial
        Products
        • Moz Pro
        • Moz Local
        • Moz API
        • Moz Data
        • STAT
        • Product Updates
        Moz Solutions
        • SMB Solutions
        • Agency Solutions
        • Enterprise Solutions
        Free SEO Tools
        • Domain Authority Checker
        • Link Explorer
        • Keyword Explorer
        • Competitive Research
        • Brand Authority Checker
        • MozBar Extension
        • MozCast
        Resources
        • Blog
        • SEO Learning Center
        • Help Hub
        • Beginner's Guide to SEO
        • How-to Guides
        • Moz Academy
        • API Docs
        About Moz
        • About
        • Team
        • Careers
        • Contact
        Why Moz
        • Case Studies
        • Testimonials
        Get Involved
        • Become an Affiliate
        • MozCon
        • Webinars
        • Practical Marketer Series
        • MozPod
        Connect with us

        Contact the Help team

        Join our newsletter
        Moz logo
        © 2021 - 2025 SEOMoz, Inc., a Ziff Davis company. All rights reserved. Moz is a registered trademark of SEOMoz, Inc.
        • Accessibility
        • Terms of Use
        • Privacy

        Looks like your connection to Moz was lost, please wait while we try to reconnect.