Answer the question
In order to leave comments, you need to log in
In the https:// version of the site, the .php extension is displayed in the address bar, in the http:// version there is no extension, how to remove the extension?
Hello!
http:// site.ru /page - displayed without the extension
https:// site.ru /page.php - the extension .php appears (when the redirect from http to https is enabled)
If you manually write https:// site.ru /page , then shows the extension
If you disable the redirect, then the http and https versions are displayed without the extension - as it should
. More: It was necessary to remove the file extension from the address bar of the http version of the site, then there was no
ssl
certificate
php" to href="page". Added the following to the .htaccess file:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
ErrorDocument 404 /404.php
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
#ErrorDocument 404 /404.php
Answer the question
In order to leave comments, you need to log in
The following code, which I found on the Internet, helped me:
RewriteEngine on
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{SERVER_PORT} !^443
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ https://centeraudit.by%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP:X-SSL-Emu} !on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question