重定向太多。使用htaccess到子文件夹的直接路径

时间:2017-05-01 07:25:51

标签: php wordpress .htaccess redirect revolution-slider

我已经将子目录中的wordpress加载到了intall。它的路径是 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文件中的重定向是必需的,因此无法将其删除。无论如何都要添加新规则并且它有效吗?

1 个答案:

答案 0 :(得分:2)

使用:

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

在最后一条规则RewriteCond之前使用RewriteRule