Answer the question
In order to leave comments, you need to log in
How to allow slash and other characters at the end of URL in htaccess file?
Good afternoon! I can't get over the slash at the end of the URL. All pages are written in php
The site easily opens at domen.ru/page.php and domen.ru/page
But when you try to access the link domen.ru/page/ gives "Not Found The requested URL was not found on this server."
There were also problems with passing GET parameters. If you pass it through the form, then the variable is passed, but if you manually write the query domain.ru/page/?id=2 into the address bar, then again "Not Found The requested URL was not found on this server."
My htaccess:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
Answer the question
In order to leave comments, you need to log in
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.*/[^/\.]+)$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question