Redirect to https. Without file extension

I have a https. I need a redirection in the .htaccess. I could find this:

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

But I find that if the user writes:

http://myDomain/someFile
It redirects to:
https://myDomain/someFile.php
I suppose that the correct should be without .php How to do that?

Those are all the rules in the .htaccess:

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php

Try this code too

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

OR

RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

I tried and it does not work. I just do not understand, why do you think it should work?, I do not see the difference

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.