unemployment Posted September 20, 2012 Share Posted September 20, 2012 I have added the code below to my .htaccess and have 404.php in my root directory: # ---------------------------------------------------------------------- # Custom 404 page # ---------------------------------------------------------------------- # You can add custom pages to handle 500 or 403 pretty easily, if you like. ErrorDocument 404 /404.php The problem I am having is that when I go to http://trekeffect.com/sss, that should redirect to my 404, but it doesn't. Instead I get: Not Found The requested URL /sss was not found on this server. Apache/2.2.21 (Ubuntu) Server at trekeffect.com Port 80 Do you know why? Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/ Share on other sites More sharing options...
premiso Posted September 20, 2012 Share Posted September 20, 2012 Your topic is incorrect. It should be "404 Not Found" Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379613 Share on other sites More sharing options...
unemployment Posted September 20, 2012 Author Share Posted September 20, 2012 You're right Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379614 Share on other sites More sharing options...
premiso Posted September 20, 2012 Share Posted September 20, 2012 Does your apache allow override in the server definition? Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379621 Share on other sites More sharing options...
unemployment Posted September 20, 2012 Author Share Posted September 20, 2012 Does your apache allow override in the server definition? My virtual host file has: <VirtualHost *:80> DocumentRoot /var/www/trekeffect.com/trekeffect.com ServerName www.trekeffect.com ServerAlias trekeffect.com <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> </VirtualHost> Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379622 Share on other sites More sharing options...
premiso Posted September 20, 2012 Share Posted September 20, 2012 Change the AllowOverride None to AllowOverride All under the /var/www and it should fix your issue after an apache restart. Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379624 Share on other sites More sharing options...
unemployment Posted September 20, 2012 Author Share Posted September 20, 2012 thank you Quote Link to comment https://forums.phpfreaks.com/topic/268608-404-not-working/#findComment-1379701 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.