pretty的URL与htaccess的?pretty、URL、htaccess

2023-09-02 00:39:32 作者:*;_耍襰皮ぷ

我刚刚创建,运行一些PHP和放了一个新词preSS的页面模板,它里面的MySQL的脚本和我想申请mod-rewrite它的子页面

i just created a new wordpress page template that runs some php&mysql scripts inside it and i would like to apply mod rewrite to it's subpages.

例如,我有以下链接生成的:

for instance i have the following link generated:

http://www.quotist.com/quotes-by- authors.html?信= D

我怎样才能将其转化成类似:

how can i transform this into something like:

http://www.quotist.com/quotes-by-authors /信/ D / ?

在我的htaccess的,我有一个字preSS生成的默认code ...

in my htaccess i have the default code generated by wordpress ...

没有人知道如何实现这一目标?

does anyone know how to achieve that?

推荐答案

试试这个:

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]