在目录中停止 .htaccess mod

编程入门 行业动态 更新时间:2024-10-23 07:14:48
本文介绍了在目录中停止 .htaccess mod_rewrite的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已将一些代码(用于 Wordpress 永久链接)复制到根目录中的 .htaccess 文件中.一切都很好.这是代码:

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>

我现在创建了一个新目录,我想使用 .htaccess 对其进行密码保护.我已经设置好了(在我想保护的目录中使用了一个 ht.access 文件),但是当我尝试浏览到受密码保护的目录时,我被重定向到主要站点 index.php 页面.

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.

我猜我需要在根目录中的 .htaccess 文件中添加一些东西?这是正确的,如果是的话,有人可以告诉我我需要添加的代码吗?

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?

推荐答案

将其放入受密码保护的 subdir .htaccess 文件.

Put this to your password protected subdir .htaccess file.

<IfModule mod_rewrite.c> #Disable rewriting RewriteEngine Off </IfModule>

更多推荐

在目录中停止 .htaccess mod

本文发布于:2023-11-01 11:51:47,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1549263.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:目录中   htaccess   mod

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!