I want to redirect all 404 errors to "404.php" for example.
I've tryed using ErrorDocument 404 /404.php
in .htaccess, but without luck, perhaps my other rules are not allowing this somehow, I'm not really sure as I couldn't find this info on www.
If anyone have idea how to solve this, please shout :P
My current .htaccess
#### pie thingy ####
AddType text/x-component .htc
#### Rule for Error Page - 404 ####
ErrorDocument 404 /404.html
#### url rewriting ####
Options +FollowSymlinks
RewriteEngine on
#### REDIRECT IF NO SUB-DOMAIN ####
RewriteCond %{HTTP_HOST} ^([^.]+)\.([^.]+)$ [NC]
RewriteRule ^(.*)$ http://www.%1.%2/$1 [R=301,L]
#### Remove "www." from any subdomain requests ####
RewriteCond %{HTTP_HOST} ^www\.([^.]+)\.precisehire\.com [NC]
RewriteRule (.*) http://%1.precisehire.com/$1 [R=301,L]
#### Rules for rewriting from PHP to HTML with fallback ####
RewriteCond %{REQUEST_URI} ^/(.*)\.html$
RewriteCond %{DOCUMENT_ROOT}/%1.php -f
RewriteRule ^(.*)\.html$ $1.php [nc]
Solved by placing full URL for error document.
Example:
#### Rule for Error Page - 404 ####
ErrorDocument 404 http://www.domain.com/404.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With