I saw this example of how to change index.php to the url name
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^([a-z0-9-_.]+)/?$ index.php?id=$1 [NC,L]
RewriteRule ^([a-z0-9-_.]+)/([a-z0-9]+)/?$ index.php?id=$1&goto=$2 [NC,L]
This .htaccess
file is inside the www.site.com/map/
directory
so what it does is change from www.site.com/map/index.php
to www.site.com/map/country
it rewrite index.php to the country name in url, the problem is when I acess a directory above or sub directory like www.site.com/map/countryname/state
it just replace the
index.phpinside the state directory to the
index.phpinside the map directory
how to solve this ? or how to make this applied to the current directory only ?
Here is the site dir structure http://ufile.io/3dii7 so when I go to site/map/state/
it works but i need the country name in url to acess state dir like this site/map/country/state/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…