0

My goal is to rewrite

http://domain.com/subdir/index.php?p=page-title

as

http://domain.com/subdir/page-title

The code below looks right, but I get a 404 Not Found?

RewriteEngine on
RewriteRule ^/subdir/([^/.]+)/?$ /subdir/index.php?p=$1 [L]
4

1 回答 1

1

请从您的规则中删除前导斜杠(假设它是 in.htaccess而不是httpd.conf

RewriteEngine on
RewriteRule ^subdir/([^/.]+)/?$ /subdir/index.php?p=$1 [NC,QSA,L]
于 2013-10-09T18:14:28.007 回答