我目前有一个 .htaccess 文件重写dyhamb.com/episode.php?episode=1
为dyhamb.com/1
. 我还想要另一个重写dyhamb.com/blogpost.php?bp=1
为dyhamb.com/blog/1
.
我已经为剧集重写设置了代码,但是当我去添加博客重写时,我似乎无法让它工作。我将如何更改以下内容以使其成为可能?
Options -Multiviews
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^dyhamb\.com$
RewriteRule ^(.*) http://dyhamb.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(0|[1-9]\d{0,2})$ /episode.php?episode=$1 [L,QSA]
RewriteRule ^/blog$ /blogpost.php?blog=$1 [L,QSA]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+episode\.php\?episode=(\d+) [NC]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+blogpost\.php\?blog=(\d+) [NC]
RewriteRule ^ %1? [R=301,L]