I have below .htaccess on the server with the not found page rules but it doesn\'t seems to work. Any idea?
RewriteEngine on
RewriteRule ^article_detail/([a-zA-Z
I'm assuming you're using Apache rather than IIS;
Ensure you have mod rewrite enabled (You can do this by locating the line below in the httpd.conf
file (usually within the /conf/
directory This maybe different if you're using shared hosting and removing the semi colon from the start of the line)
;LoadModule rewrite_module modules/mod_rewrite.so
Find the relevant directory tag for your www root and change AllowOverride None
to AllowOverride All
Create an .htaccess file within the root directory (If one doesn't exist)
You'd need to insert something that looks like this;
ErrorDocument 500 /errordocs/500.html
ErrorDocument 404 /errordocs/404.html
ErrorDocument 401 /errordocs/401.html
ErrorDocument 403 /errordocs/403.html
Instead of ErrorDocument 404 /errordocs/404.html
you could also do ErrorDocument 404 http://www.yourdomain.com/errordocs/404.html
or even just display a simple message ErrorDocument 404 "Sorry can't allow you access today"
If you have any trouble the Apache Manual (ErrorDocument Directive) should help you out further.
In your case make sure AllowOverride All
is on, your editing the .htaccess
file in the root and make sure you can hit the URL for the error page, if there's nothing at the URL that you specify Apache will return the default 404.