我有3个目录级别的页面,城市,类别和业务
e.g。新约克/餐馆/麦当劳。
所以我有city.php,category.php和business.php
e.g。 city.php?url = new-york,category.php?url = new-york / restaurants,and business.php?url = mcdonalds
我将如何创建一个mod_rewrite: / new-york,/ new-york / restaurants和/ mcdonalds
答案 0 :(得分:0)
试试这个
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^/new-york/(.*)$ category.php?url=new-york/$2 [L]