我刚刚创建了一个新的 WordPress 页面模板,在其中运行一些 php&mysql 脚本,我想对其子页面应用 mod 重写。
例如我生成了以下链接:
http://www.quotist.com/quotes-by-authors.html?letter=D http://www.quotist.com/quotes-by-authors.html?letter=D
我怎样才能把它变成这样的东西:
http://www.quotist.com/quotes-by-authors/letter/d/ http://www.quotist.com/quotes-by-authors/letter/d/ ?
在我的 htaccess 中,我有由 wordpress 生成的默认代码...
有谁知道如何实现这一目标?
尝试这个:
Options +FollowSymLinks -MultiViews -Indexes
RewriteEngine on
RewriteBase /
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule ^ - [L]
RewriteCond %{QUERY_STRING} ^(letter)=(\w)$ [NC]
RewriteRule ([^.]+)\.html http://www.quotist.com/$1/%1/%2? [L,R=301]
RewriteCond %{REQUEST_URI} ^/([\w-]+)/(letter)/\w/? [NC]
RewriteRule ^ /%1.html?%2=%3 [L,QSA]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)