homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Large .HTACCESS - Will it cause problems?

5+ Year Member

Msg#: 3590195 posted 7:33 pm on Mar 3, 2008 (gmt 0)

I am about to create an .htaccess file with more than 5,000 301 redirect. Will this cause any problems, slowness, or anything unusual?

Thanks in advance!



WebmasterWorld Senior Member g1smd us a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Msg#: 3590195 posted 8:47 pm on Mar 3, 2008 (gmt 0)

Surely you can use several simple rewriterule conditions to do this by pattern matching.


WebmasterWorld Senior Member jdmorgan us a WebmasterWorld Top Contributor of All Time 10+ Year Member

Msg#: 3590195 posted 9:45 pm on Mar 3, 2008 (gmt 0)

I agree that pattern-based redirects as implemented by mod_rewrite or mod_alias' RedirectMatch can probably be used to greatly reduce the number of redirect directives needed.

However, to answer your question a bit more directly: The server performance impact of 5000 lines of code will depend on how many requests per second you get, how fast your server's CPU is, how much physical memory it has, and if it is shared, how many other sites it is shared with, and how busy they are.

If you're on a fast dedicated server with a lot of memory, you may not notice a performance problem until you reach several thousand requests per minute. If you are on heavily-shared hosting on a typical server, then you may have problems handling only one or two dozen requests per second...

Realize that every one of these redirect directives will be processed for each and every HTTP request to your server -- For every page, image, script, multimedia file, or stylesheet request. That is, unless you write the code to prevent this by making some of the code conditional (e.g. "skip this code except for .html page requests").

I would not recommend implementing 5000 redirects, either from a server-performance perspective, or from an SEO standpoint; You may destroy your site pages' ranking in search engines by making such a large change so suddenly.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved