php - dynamic page redirection with .htaccess
I have removed all .php extension from all the pages. It is working fine, but after that, if I Check my site with abc.php it is also working.
So how can I redirect page if someone write abc.php to the abc page without .php extension.
Below is my code for remove .php extension in .htaccess file.
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Can someone help me in this.
Answer
Solution:
You may use these set of rules: