【问题标题】:301 redirection for new site新网站的301重定向
【发布时间】:2020-01-08 04:24:03
【问题描述】:

我已将我的 wordpress 网站迁移到 html 网站。我想将我的 wordpress url 重定向到现有的 html url。我在新的 html 项目文件中创建了 .htaccess。

旧网址https://test.testproject.net/aboutus/rewards-and-recognitions.html 新网址https://test.testproject.net/features/rewards-and-recognitions.html

旧网址https://test.testproject.net/events/upcoming-events-archive.html 新网址https://test.testproject.net/events.html

旧网址https://test.testproject.net/product-overview/rewards-recognition.html 新网址https://test.testproject.net/features/rewards-recognition.html

旧网址https://test.testproject.net/features/ 新网址https://test.testproject.net/features.html

.htaccess
 ErrorDocument 404 /not-found.html
 Options -Indexes
  Redirect aboutus/rewards-and-recognitions.html  http://test.testproject.net/features/rewards-recognition.html   [R=301,L]

我已经在新的 html 文件夹路径中编写了我的 htaccess,用于所有旧到新的 url。

Redirect aboutus/rewards-and-recognitions.html  http://test.testproject.net/features/rewards-recognition.html   [R=301,L] //shows forbidden error

如何为上述所有从旧到新的 url 重定向编写 htaccess

【问题讨论】:

    标签: php html wordpress apache .htaccess


    【解决方案1】:
    Redirect 301 [new_page] [old_page]
    

    打开您的 .htaccess 文件。在带有方括号的第一个值中键入旧页面。在第二个中,键入新页面。这将在访问该站点时将用户重定向到新页面。在你的情况下,你应该输入。

     Redirect 301 aboutus/rewards-and-recognitions.html 
     http://test.testproject.net/features/rewards-recognition.html
    

    【讨论】:

      猜你喜欢
      • 2023-03-02
      • 1970-01-01
      • 2011-07-25
      • 2017-02-04
      • 1970-01-01
      • 2011-07-03
      • 2012-12-17
      • 2010-10-18
      • 2017-09-21
      相关资源
      最近更新 更多