本文介绍了防止htaccess中的文件夹重定向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下规则位于htaccess文件中,需要保留:
The following rules are in an htaccess file and need to remain:
# GENERAL
RewriteRule ^([A-Za-z_0-9\-]+)$ /index.php?page=$1 [QSA]
RewriteRule ^([A-Za-z_0-9\-]+)/$ /index.php?page=$1 [QSA]
RewriteRule ^([A-Za-z_0-9\-]+)/([a-z]+)$ /index.php?page=$1&comp=$2 [QSA]
RewriteRule ^([A-Za-z_0-9\-]+)/([a-z]+)/$ /index.php?page=$1&comp=$2 [QSA]
但是,我需要防止特定文件夹重定向,我们将其命名为/folder/
However, I need to prevent a specific folder from redirecting, lets call it /folder/
我似乎无法正常工作,希望有人能提供帮助.
I can't seem to get it to work correctly and hope someone can help.
谢谢!
推荐答案
添加到顶部:
RewriteRule ^folder/ - [L,NC]
这篇关于防止htaccess中的文件夹重定向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!