【问题标题】:URL rewrite query_string in wordpress在 wordpress 中 URL 重写 query_string
【发布时间】:2012-07-29 12:48:14
【问题描述】:

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

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

但我希望它被重写为

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

我找到了this,但无法实现我的情况。有什么帮助吗?

【问题讨论】:

    标签: php wordpress apache


    【解决方案1】:

    试试这个RewriteRule:

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

    【讨论】:

    • 它给出“500 内部服务器错误”
    • @Adige72,尝试省略 RewriteBase 指令。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-04
    • 2019-05-13
    • 1970-01-01
    • 1970-01-01
    • 2013-08-01
    • 1970-01-01
    相关资源
    最近更新 更多