- - Code, Content, and Presentation
- -- Apache Web Server
- ---- RewriteRules and .htaccess
g1smd - 7:42 pm on Aug 18, 2011 (gmt 0)
Redirects cause the browser to make a new request and mod_rewrite processing starts again from the top.
Your non-www to www redirect must be listed AFTER the index redirect otherwise non-www index requests will cause an unwanted two-step redirection chain.
You should escape the periods in the
!^www.example.com$ pattern as well as stopping this rule causing an infinite redirect loop for HTTP/1.0 requests. Use:
You should add a plain text comment before each block of code explaining what it does. Add a blank line after each RewriteRule.
Use example.com in the forum to stop URL auto-linking.
It only stops if all the patterns for this rule actually matched.
|Every time mod_rewrite encounters an [L], it stops what it's doing. |
Thread source: http://www.webmasterworld.com/apache/4353045.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com