避免对特定文件夹的Word preSS的.htaccess规则 [英] Avoiding Wordpress .htaccess rules on specific folder

查看:174
本文介绍了避免对特定文件夹的Word preSS的.htaccess规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装在词根preSS并没有涉及到Word preSS特定的文件夹。我创建了一个.htaccess文件为特定的文件夹,但它不工作。在Word preSS的.htaccess总是被调用。

I have Wordpress installed in root and a particular folder not related to Wordpress. I created a .htaccess file for the particular folder, but it is not working. The Wordpress .htaccess is always been called.

字preSS的.htaccess:

Wordpress .htaccess:

# BEGIN WordPress
#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteBase /
#RewriteRule ^index\.php$ - [L]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule . /index.php [L]
#</IfModule>
# END WordPress

特定文件夹的.htaccess:

Particular folder .htaccess:

//301 Redirect Old File
Redirect 301 http://www.domain.com/folder/start.php http://www.domain.com/folder/index.php

当我打开上面的旧地址(不存在),字preSS的.htaccess被调用,而不是使用该文件夹的。htaccess的重定向。

When I load the above old address (that does not exists), the Wordpress .htaccess is called, instead of use the folder's .htaccess to redirect.

推荐答案

您不必多的.htaccess 你可以把所有的规则上的字preSS主要的.htaccess

You don't need multiple .htaccess you can put all the rules on the WordPress main .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !^folder
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

使用两种:

RewriteRule ^folder/start\.php$ /folder/index.php [R=301,L,NC]

Redirect 301 /folder/start.php http://www.domain.com/folder/index.php

不要忘了改文件夹您的实际文件夹的名称。

Don't forget to change folder to your actual folder name.

这篇关于避免对特定文件夹的Word preSS的.htaccess规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆