stop .htaccess mod_rewrite in a directory

守給你的承諾、 提交于 2021-02-18 21:57:37

问题


I have copied some code (for Wordpress permalinks) into my .htaccess file in the root directory. All has been working fine. This is the code:

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

I've now created a new directory that I want to password protect using .htaccess. I've set that up (using a ht.access file in the directory I want to protect) but when I try to browse to the password protected directory I get re-directed to the main sites index.php page.

I'm guessing I need to add something to the .htaccess file in the root directory? Is this correct and if so could someone tell me the code I need to add?


回答1:


Put this to your password protected subdir .htaccess file.

<IfModule mod_rewrite.c>

#Disable rewriting
RewriteEngine Off

</IfModule>


来源:https://stackoverflow.com/questions/10143068/stop-htaccess-mod-rewrite-in-a-directory

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