我在以下我的一个 wordpress 网站上设置 mod rewrite 时遇到问题是 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/ 显示页面 - 但显然没有第二个变量