简体   繁体   中英

error 404 page is not displayed

I have a little problem with my ERROR 404 page. In my .htaccess file I have this:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule [^/]$ %{REQUEST_URI}/ [L,R=301, NE]

the code for add "/" to the end of URL. This code works fine on all pages, but when I use it for error 404 page, web browser don' t show my own error 404 page, but show ERROR 403 page of my webhosting provider. So, when I use " http://www.recension4u.com/error " it works fine, but when I use " http://www.recension4u.com/error/ " it makes the problem. Please can you help me? For all advice thanks in advance.

Try with below code. It may help you.

RewriteCond %{THE_REQUEST} ^GET
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+?)/$ /$1 [L,R=301]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM