认为用户输入
localhost/app/public/anything/anything/index/php/id/5
然后id喜欢将其更改为
localhost/app/public/index.php?id=5
我写的表达是
RewriteRule ^index/php/id/([0-9]+)$ http://localhost/saecms/public/index.php?id=$1 [L]
但它不起作用,这里有什么不对?谢谢
答案 0 :(得分:1)
您可以在/app/public/.htaccess
文件中使用此规则:
RewriteEngine On
RewriteBase /app/public/
RewriteRule (?:^|/)index.php/id/(\d+)/?$ index.php?id=$1 [L,QSA,NC]