这是我的.htaccess
的代码RewriteEngine on
RewriteRule ^play/([0-9]+)_(.+)$ file.php?f=$1&name=$2 [L]
我的链接
sitename.com/play/399_Beauty_Barbie_hair
但是,我希望它像这样
sitename.com/play/Beauty_Barbie_hair
我怎样才能实现这个目标?
答案 0 :(得分:0)
您需要另一条处理新URI结构的规则:
RewriteEngine on
RewriteBase /
RewriteRule ^play/([0-9]+)_(.+)$ file.php?f=$1&name=$2 [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^play/(.+)$ file.php?f=$1&name=$2 [L,QSA]