.htaccess RewriteRule在我的网站上不起作用

时间:2014-10-25 16:24:49

标签: .htaccess url mod-rewrite url-rewriting rewrite

我如何重写这个网址:

http://www.example.com/delete-album?album_id=52

到此:

http://www.example.com/album/52/delete

这是我的.htaccess代码,它不起作用:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^album/([0-9]+)/?$/delete delete-album?album_id=$1 [L,QSA]

1 个答案:

答案 0 :(得分:0)

您的RewriteRule

中的正则表达式不正确
RewriteRule ^(album)/(\d+)/(delete)/?$ $3-$1?album_id=$2 [L,QSA,NC]