michal s
michal s

Reputation: 131

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.

Upvotes: 0

Views: 45

Answers (1)

Harsh Barach
Harsh Barach

Reputation: 957

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]

Upvotes: 2

Related Questions