【问题标题】:Mod_rewrite to direct subdirectory to another URLMod_rewrite 将子目录指向另一个 URL
【发布时间】:2015-05-01 05:41:00
【问题描述】:

我正在尝试使用 Apache Mod_rewrite,但我无法让它工作。

我想重定向

xyz.com/blog 到 xyz.wordpress.com

我编辑了 .htaccess 文件以添加这一行。

RewriteRule ^blog/?$ http://xyz.wordpress.com/$1 [NC]

但它不起作用。

【问题讨论】:

    标签: php wordpress apache http mod-rewrite


    【解决方案1】:

    试试这个。

    RewriteRule ^blog/(.*)$ http://xyz.wordpress.com/$1 [NC]
    

    别忘了添加

    RewriteEngine on
    

    在 RewriteRule 之上。

    【讨论】:

      猜你喜欢
      • 2013-12-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-11-24
      • 2021-06-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多