【问题标题】:Too many redirects. Rirect path to subfolder using htaccess重定向太多。使用 htaccess 将路径重定向到子文件夹
【发布时间】:2017-05-01 07:25:50
【问题描述】:

我已经在子目录中加载了 wordpress 以进行安装。它的路径是 public_html/revslider-standalone

这是完整路径 http://greenlinerenovations.com/revslider-standalone

当我在浏览器中打开此 URL 时,它显示重定向过多。下面是我的 .htaccess 代码

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^About+$ about.php
RewriteRule ^FAQ+$ faq.php
RewriteRule ^Contact+$ contact.php
RewriteRule ^Gallery+$ gallery.php
RewriteRule ^Areas-we-service+$ cities.php


RewriteRule ^(([^/]+/)*[^.]+)$ servicesparse.php?name=$1

应该添加或更正什么规则才能在该路径上安装 Wordpress? htaccess 文件中的重定向是必需的,因此无法删除它。无论如何添加新规则并且它有效?

【问题讨论】:

    标签: php wordpress .htaccess redirect revolution-slider


    【解决方案1】:

    用途:

    RewriteEngine On
    
    RewriteRule ^About$ about.php [NC,L]
    RewriteRule ^FAQ$ faq.php [NC,L]
    RewriteRule ^Contact$ contact.php [NC,L]
    RewriteRule ^Gallery$ gallery.php [NC,L]
    RewriteRule ^Areas-we-service$ cities.php [NC,L]
    
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule ^(([^/]+/)*[^.]+)$ servicesparse.php?name=$1
    

    在最后一条规则之前RewriteCondRewriteRule

    【讨论】:

    • RewriteCond 仅适用于下一个RewriteRule
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-02
    • 2019-05-15
    • 1970-01-01
    • 2017-12-05
    • 1970-01-01
    • 2014-06-01
    相关资源
    最近更新 更多