【问题标题】:Wordpress : redirect all .pdf to one pageWordpress:将所有.pdf重定向到一页
【发布时间】:2020-09-14 14:06:51
【问题描述】:

迁移到 wordpress 后,我希望将所有旧地址 www.mondomaine.fr/pages/files/PDF/*.pdf 转移到 www.mondomaine.fr/catalogue

我尝试了几种 REDIRECT 语法,但它在新 URL 中添加了 pdf 文件的名称,所以我最终得到了 404

谢谢!

【问题讨论】:

    标签: .htaccess pdf migration


    【解决方案1】:

    RewriteRule ^pages/files/PDF/([A-Za-z0-9-]+).pdf /catalogue [L,R=301]

    【讨论】:

      【解决方案2】:

      谢谢!不幸的是,此代码 RewriteRule ^pages/files/PDF/([A-Za-z0-9-]+).pdf /catalogue [L,R=301] 不起作用。 这是我的 .htaccess - 我指定索引网址不是 https。

      <IfModule mod_rewrite.c>
      
      RewriteEngine On
      
      RewriteBase /
      
      RewriteRule ^pages/file/PDF/([A-Za-z0-9-]+).pdf https://www.jmbidentification.com/catalogues/ [L,R=301]
      
      RewriteRule ^index\.php$ - [L]
      
      RewriteCond %{REQUEST_FILENAME} !-f
      
      RewriteCond %{REQUEST_FILENAME} !-d
      
      RewriteRule . /index.php [L]
      
      </IfModule>
      

      【讨论】:

        猜你喜欢
        • 2015-08-20
        • 2016-02-27
        • 1970-01-01
        • 2012-11-06
        • 2015-12-27
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多