繁体   English   中英

URL在wordpress中重写query_string

[英]URL rewrite query_string in wordpress

我在wordpress中有一个分类搜索表单,链接输出为

http://localhost/wp/?cityid=16

但我希望它rewrited为

http://localhost/wp/cityid/16

.htaccess

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wp/index.php [L]
</IfModule>

# END WordPress

我发现这个 ,但不能落实到我的情况。 有什么帮助吗?

试试这个RewriteRule

RewriteBase /wp/
RewirteRule ^wp/cityid/([0-9]+)$ ?cityid=$1 [L]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM