Prevent folder redirect in htaccess

做~自己de王妃 提交于 2019-12-14 02:11:50

问题


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]

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.

THanks!!!


回答1:


add at the top:

RewriteRule ^folder/ - [L,NC]


来源:https://stackoverflow.com/questions/17350598/prevent-folder-redirect-in-htaccess

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!