在wordpress上使用多个参数重写mod

时间:2013-10-23 13:21:40

标签: wordpress .htaccess mod-rewrite

我在下面的一个wordpress网站上设置mod重写有问题是htaccess:

# BEGIN s2Member GZIP exclusions
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} (^|\?|&)s2member_file_download\=.+ [OR]
    RewriteCond %{QUERY_STRING} (^|\?|&)no-gzip\=1
    RewriteRule .* - [E=no-gzip:1]
</IfModule>
# END s2Member GZIP exclusions

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^book/([^-]*)/([^-]*)$ book/?bookid=$1&bookt=$2
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

下线似乎无法正常工作

RewriteRule ^book/([^-]*)/([^-]*)$ book/?bookid=$1&bookt=$2

我想要链接www.example.com/book/1/tittle显示内容来自www.example.com/book/?bookid=1&bookt=tittle

编辑: 这可能会有所帮助:
www.example.com/book/1/test显示“找不到页面”,而www.example.com/book/1/显示页面 - 但显然没有第二个变量

1 个答案:

答案 0 :(得分:0)

尝试添加L标记:

RewriteRule ^book/([^-]*)/([^-]*)$ book/?bookid=$1&bookt=$2 [L]