【问题标题】:.htaccess URL rewrite with no query string variables.htaccess URL 重写,没有查询字符串变量
【发布时间】:2011-09-29 06:41:39
【问题描述】:

我必须重写以下 URL,有人可以建议一个 .htaccess 文件的内容来做到这一点。

例如:

example.com/retrieve_cat.php?subcat=364&c=134

需要看起来像:

example.com/category/subcategory/

可以重写吗?

【问题讨论】:

    标签: .htaccess mod-rewrite url-rewriting


    【解决方案1】:
    Options +FollowSymLinks
    Options +Indexes
    RewriteEngine On
    RewriteBase /
    RewriteRule ^retrieve_cat.php?subcat=(.*)&c=(.*) $2/$1/
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-01-02
      • 2012-11-15
      • 2023-03-04
      • 2012-06-16
      • 2012-09-19
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多