免责声明:我对网址重写一无所知
目前我的网址看起来像
legalHQWithNewAddressTable/legalHQ/public/admin/Parties.php?caseid=7 (any number basically)
但是我怎么能让它看起来像下面的
legalHQWithNewAddressTable/legalHQ/public/admin/Parties/caseid/7/
我正在尝试但没有工作RewriteRule ^([a-zA-Z0-9]+)/?
请不要让事情变得复杂我对网址重写一无所知,所以请尽量保持简单。
任何想法?
答案 0 :(得分:3)
尝试将这些规则添加到/legalHQWithNewAddressTable/legalHQ/public/
文件夹中的htaccess文件中:
RewriteEngine On
RewriteBase /legalHQWithNewAddressTable/legalHQ/public/
RewriteCond %{THE_REQUEST} /admin/([A-Za-z0-9]+)\.php\?caseid=([0-9]+)&?([^\ ]*)
RewriteRule ^ admin/%1/caseid/%2/?%3 [L,R]
RewriteRule ^admin/([A-Za-z0-9]+)/caseid/([0-9]+)/ admin/$1.php?caseid=$2 [L,QSA]
答案 1 :(得分:1)
将此规则放在/legalHQWithNewAddressTable/legalHQ/public/admin/.htaccess
:
Options -MultiViews
RewriteEngine On
RewriteBase /legalHQWithNewAddressTable/legalHQ/public/admin/
RewriteRule ^Parties/caseid/([0-9]+)/?$ Parties.php?caseid=$1 [L,QSA,NC]