Hide page extension and skip bar at the end

Asked

Viewed 71 times

-2

I currently use the following code to hide the extension on the pages of the site:

RewriteEngine On
Options +FollowSymLinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} (.*)/([^/]+)(\?.*)?$
RewriteCond %1/%2.php -f
RewriteCond %{REQUEST_URI} (.*)/([^/]+)(\?.*)?$
RewriteRule .* %1/%2.php [QSA]

This way I can access the site like this: meusite.com.br/page

The problem is that if I put a bar at the end (meusite.com.br/page/) error 404. How can I fix this?

1 answer

-3

Are you using your php file as a folder? Using this code makes . php disappear from your site url.. That’s all it is.

The way Voce said, you are trying to open your php file as a folder, see: www.meusite.com/page/ would be the same thing as www.meusite.com/page.php/, use so will give error

Ah not be that you create a folder called page instead of using the php file.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.