Wordpress 是否可以使用参数重写URL?
我有一个URLWordpress 是否可以使用参数重写URL?,wordpress,.htaccess,url,mod-rewrite,Wordpress,.htaccess,Url,Mod Rewrite,我有一个URLexample.com/photo?people 我想将此URL改写为:example.com/photo/people 可能吗 你的真实示例url是什么?people更可能是一个键/值,比如?people=something或?something=peopleexample.com/photo?people和example.com/photo?people=Steffi那么people=Steffi的重写url是什么样子呢?example.com/photo/people/Ste
example.com/photo?people
我想将此URL改写为:
example.com/photo/people
可能吗 你的真实示例url是什么
?people
更可能是一个键/值,比如?people=something
或?something=people
example.com/photo?people
和example.com/photo?people=Steffi
那么people=Steffi的重写url是什么样子呢?example.com/photo/people/Steffi
如果我的url是:example.com?people
我想要example.com/people
?@Steffi我想你必须先定义你想要的结构,但那将是:RewriteRule^(\w+)$/$1
。重写URLhttp://www.example.com/2011/photo/peopleforhttp://www.example.com/2011/photo?people
不适用于重写规则^(\w+)$/$1
@Steffi不适用。就像我说的,你必须先定义你的url结构。@Steffi例如,如果第一部分是一个数字,然后是一个类型,然后是一个部分,你可以做RewriteRule^(\d+/(\w+)/(\w+)/(\w+)/?year=$1&type=$2§ion=$3
RewriteEngine On
RewriteBase /
RewriteRule ^photo/(\w+)$ /photo?$1