Page is a not externally linkable
- Code, Content, and Presentation
-- Apache Web Server
---- mod rewrite issue where directory actually exists


g1smd - 9:25 pm on Jan 18, 2013 (gmt 0)


First thing is to change the code in the following ways:

Every rule needs the
[L] flag.

Every redirect should include the protocol and hostname in the rule target.

Rules that rewrite (rather than redirect) must not include the protocol and hostname in the rule target, just the path and file.

List all of the rules that redirect before the rules that rewrite.

Put all of the rules in the root htaccess, modifying the RegEx pattern to include the full path when you move a rule from the htaccess file in a folder, i.e. pattern like
^filename becomes ^folder/filename

Slashes in patterns do not need to be escaped.

List the redirects in order from "most specific" to "most general".

Add a blank line after every
RewriteRule to make the code more readable.

Once we've got those out of the way, we can look deeper.


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