Htaccess maximum size?
-
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 -
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.
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
-
Handling Multiple Domain 301 Redirects on Single htaccess file
Hello, I have a client that currently that has 9 different markets with different sub-domains on one server (aka one htaccess file.). All the sites have very similar Navigation and some of them contain the same products aka same URLs. The site is using Magento CMS and I'm trying to figure out how to redirect some products that have been removed from one of the stores. The problem I'm running into is when I try to redirect one store url, it redirects all the site's URLs. Example http://store.domain1.com/ http://store.domain2.com/ I'd like to redirect http://store.domain1.com/old-url.html to http://store.domain1.com/new-url.html without making http://store.domain2.com/old-url.html redirect. I've literally been pulling out my hair trying to figure this one out but have had no luck. Does anybody have any ideas on how I could do this without having the sites redirect or create any loops? Any wisdom from you apache experts would be greatly appreciated. Thanks, Erik
Intermediate & Advanced SEO | | Erik-M0 -
How to structure links on a "Card" for maximum crawler-friendliness
My question is how to best structure the links on a "Card" while maintaining usability for touchscreens. I've attached a simple wireframe, but the "card" is a format you see a lot now on the web: it's about a "topic" and contains an image for the topic and some text. When you click the card it links to a page about the "topic". My question is how to best structure the card's html so google can most easily read it. I have two options: a) Make the elements of the card 2 separate links, one for the image and one for the text. Google would read this as follows. //image
Intermediate & Advanced SEO | | jcgoodrich
[](/target URL) //text
<a href=' target="" url'="">Topic</a href='> b) Make the entire "Card" a link which would cause Google to read it as follows: <a></a> <a>Bunch of div elements that includes anchor text and alt-image attributes above along with a fair amount of additional text.</a> <a></a> Holding UX aside, which of these options is better purely from a Google crawling perspective? Does doing (b) confuse the bot about what the target page is about? If one is clearly better, is it a dramatic difference? Thanks! PwcPRZK0 -
Redirects in .htaccess file
I am using yoast seo plugin for wordpress. I have done several link changes and placed approximately 80-100 301 redirect into .htaccsses file. Is this good practice? Do they have to be there forever? Is it not slowing down site? Or should this be done in different way? Thank you very much Iris
Intermediate & Advanced SEO | | Rebeca10 -
.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 | | Townpages0 -
Htaccess 301 regex question
I need some help with a regex for htaccess. I want to 301 redirect this: http://olddomain.com/oldsubdir/fruit.aspx to this: https://www.newdomain.com/newsubdir/FRUIT changes: different protocol (http -> https) add 'www.' different domain (olddomain and newdomain are constants) different subdirectory (oldsubdir and newsubdir are constants) 'fruit' is a variable (which will contain only letters [a-zA-Z]) is it possible to make 'fruit' UPPER case on the redirect (so 'fruit' -> 'FRUIT') remove '.aspx' I think it's something like this (placed in the .htaccess file in the root directory of olddomain): RedirectMatch 301 /oldsubdir/(.*).aspx https://www.newdomain.com/newsubdir/$1 Thanks.
Intermediate & Advanced SEO | | scanlin0 -
E-Commerce Selling Air Filter. Only 3 Qualities Options in 50 Sizes, Total 150 items. HELP!!!
My online store is selling air furnace filters. We only have 3 different filters to sell. (standard, mid-range quality and high quality) Each filters is available in 50 different sizes. This is a TOTAL of 150 products or 3 products with 50 options!!! My store is setup with the ''150 products'' option. MY PROBLEMS: All the page Title are the same, only the filter is change in the page title. ex: 10x20x1 furnace filters - shop at furnace filters canada 12x20x1 furnace filters - shop at furnace filters canada 14x20x1 furnace filters - shop at furnace filters canada ect... It is the same with the Meta Description, all the same only the size change. It is the same with the product description, all the same, only the size is changing. Trying to come out with 150 different page title, meta and product description is almost impossible. And you know like me, most shoppers will use there filters sizes in there keywords search term or phrase. YES, I have duplicate content all over my store. Is there a solution to this? This is my online store http://www.furnacefilterscanada.com/ Thank you, BigBlaze
Intermediate & Advanced SEO | | BigBlaze2050 -
.htaccess files
I am working with a clients website which has multiple htaccess files (.htaccess , .htaccess.holiding, and .htaccess.live -all in the same directory) My question is how does a server process these files? All 3 files? Currently the domain has 301 redirect showing for the home page to the mobile site (which is a problem) in one of the files (.htaccess but not others) Has anyone come across this before with regard to SEO problems?
Intermediate & Advanced SEO | | OnlineAssetPartners0 -
Link building maximum to different sub domains?
Hi All, I'm launching a new website with a number of country specific sub-domains and I wanted to know if Google will calculate the number of new links as a root domain or if it will treat each subdomain seperately? For instance if I built 50 links per month to each of my five proposed subdomains would google see it as 250 links built to one root domain(and penalise me as a result) or will they view these subdomains independantly and accept these 50 links per page as an acceptable amount per sub domain. Thanks in advance. Ross
Intermediate & Advanced SEO | | Mulith0