Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 是否可以使用参数重写URL?_Wordpress_.htaccess_Url_Mod Rewrite - Fatal编程技术网

Wordpress 是否可以使用参数重写URL?

Wordpress 是否可以使用参数重写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

我有一个URL
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
。重写URL
http://www.example.com/2011/photo/people
for
http://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