i have a file named Show.php
i want to remove .php extension of this, and if someone requested /Show.php, redirect him to without .php extension Page.
This is my
REQUEST_URI
, unlike the RewriteRule
expression, begins with a leading /
but your expression begins with ^Show
. Simply adding the leading slash should do the job. Everything else looks correct.
RewriteCond %{REQUEST_URI} ^/Show\.php$
#-------------------------^^^^^
RewriteRule ^Show\.php$ Show [R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
#Rewrite to Show.php rather than ./Show.php
RewriteRule ^Show$ Show.php [L]