Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- 301'ing over 50 thousand pages


jdMorgan - 7:49 pm on Mar 9, 2011 (gmt 0)


Since this is a redirect, I strongly suggest putting the code (as posted) into the root .htaccess file. Otherwise, you preclude the use of *any* internal rewrites in the root .htaccess file which might affect the subdirectory -- now or later.

This is because if any external redirect is done after an internal rewrite, that redirect will 'expose' the rewritten (filepath) as a URL to the client. This defeats the 'pretty URL' techniques and makes a big mess of search engine listings and rankings.

Across all .htaccess files in the directory-path traversed by any given URL request:
Your rules must be ordered with all external redirects first, in order from most-specific patterns and conditions (e.g. single or only a few URLs affected) to least-specific patterns and conditions (e.g. more URLs affected), followed by all internal rewrites, again in order from most- to least-specific.

This requires quite a bit of on-going care with rule order when multiple .htaccess files are to be used.

Failure to take that on-going care can put you out of business in less than a month. This should definitely be considered as part of the performance/maintenance trade-offs between directory-localized and 'global' .htaccess files -- and between server config files and .htaccess files as well, where applicable.

Jim


Thread source:: http://www.webmasterworld.com/apache/4278367.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com