Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

If apache2 rewrite engine lines are before ErrorDocument lines, it works. But if after ErrorDocument, they don't. Why?

$
0
0

Recently, I've added rewrite lines to my .htaccess file like so:

ErrorDocument 404 /error_pages/404.htmlErrorDocument 401 /error_pages/401.htmlRewriteEngine OnRewriteCond %{HTTP_HOST} www.thehowtobrainiac.comRewriteRule (.*) http://thehowtobrainiac.com/$1 [R=301,L]

This didn't work, and I have no idea why it came to my mind, I tried switching the ErrorDocument and RewriteBlahBlah like this:

RewriteEngine OnRewriteCond %{HTTP_HOST} www.thehowtobrainiac.comRewriteRule (.*) http://thehowtobrainiac.com/$1 [R=301,L]ErrorDocument 404 /error_pages/404.htmlErrorDocument 401 /error_pages/401.html

Now it works. That's great, but I would like to know why it works, and the other way doesn't?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>