Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Become a Pro Member
ErrorDocument help moxie Where do I place this code? ErrorDocument 404 /404.php Do I place it before my index and non-canonical redirects or after? It must come before any rewrites, am I correct? Any help would be appreciated. Thanks in advance!
Put it near the top of your htaccess along with any other one-offs: Options, Include lines and so on. Technically the ErrorDocument is a kind of rewrite. But it isn't done with mod_rewrite, so location doesn't matter. Each module is an island; they execute in a fixed order, no matter where you've put them in htaccess. moxie
Okay that works great! I love learning this stuff. Thanks lucy24! g1smd
The htaccess file is processed by each Apache module in turn, not in the order the directives appear on the page. The order that the modules are activated is defined elsewhere within Apache. However, for the various directives processed by the same module, the order IS important, because each module DOES process it's own directives in the order shown in the htaccess file. Put all the mod_auth stuff together, all the mod_rewrite stuff together, etc. topr8
thanks for clearing that up g1smd ... as i put the ErrorDocument codes last! g1smd
I tend to put them first, rather than bury them after a lot of mod_rewrite code. It doesn't really matter all that much. moxie
Hey thanks g1smd for that extra information, as I was certainly not aware of that.