Answer the question
In order to leave comments, you need to log in
Why redirect error?
Hi, I redirected from .php to without and removed the / at the end. When you enter an address, say site.com/xxx.php, it redirects to site.com/xxx. Just what you need, only an error appears that such a file was not found. Although there is a xxx.php file in the root directory.
Here is the error itself: The requested URL /xxx was not found on this server.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule .* http://%{HTTP_HOST}%1 [R=301,L,QSA]
RewriteCond %{REQUEST_URI} ^(.+)\.php$
RewriteRule ^(.+)\.php$ /$1 [R=301,L]
Answer the question
In order to leave comments, you need to log in
I have examples of both here.
https://klondike-studio.ru/standards/standartnyy-h...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question