Directly have the root directory as shown below, as you can see I have a folder and file with the same name as store , you Can you please let me know how to write RewriteRule
in .htaccess
to redirect any request like
http://clients/shop/
orhttp://clients/shop
to
http://clients/shop.php
I already tried it
RewriteRule ^shop/(.+) shop.php [L,R]
But this adds the wrong address to the URL
======================
renew
====================
Okay, I found this solution works to some extent
DirectorySlash Off RewriteEngine on RewriteCond %{THE_REQUEST} \s/+shop [NC] RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*) /.php [R=302,L]
But, it only works when the request is like http://clients/shop
, and it shows the directory page when the request is like http://clients/shop/
This should do the job for you