【问题标题】:Using .htaccess to redirect all pages on wordpress to homepages except page with .html使用 .htaccess 将 wordpress 上的所有页面重定向到主页,但带有 .html 的页面除外
【发布时间】:2014-05-08 21:18:14
【问题描述】:

如何使用 .htaccess 将 wordpress 上的所有页面重定向到主页,扩展名为 .html 的页面除外

【问题讨论】:

  • 你有没有尝试过?如果是,请分享您的代码。

标签: .htaccess redirect


【解决方案1】:

我猜你已经安装了 wordpress,但现在没有了,并且想将以前链接到 wordpress 中的博客的所有 url 重定向到站点根目录。如果是这种情况,请删除将 url 重写为 wordpress 的 index.php 的规则并添加以下规则

RewriteCond %{REQUEST_URI} !\.html$
RewriteCond %{REQUEST_URI} !^/$
RewriteRule ^ http://www.example.com [R,L]

【讨论】:

    猜你喜欢
    • 2016-11-30
    • 2020-03-11
    • 1970-01-01
    • 2016-11-08
    • 1970-01-01
    • 1970-01-01
    • 2011-11-04
    • 2022-06-30
    • 1970-01-01
    相关资源
    最近更新 更多