0

我有一个在根文件夹上运行的 codeigniter 项目。在名为 ems2 的文件夹上的同一服务器上,另一个项目正在运行。但是由于 codeigniter 项目的根 .htaccess,ems2 项目无法正常工作。如何从 ems2 文件夹中删除 .htaccess 控制?

我在根目录下的 .htaccess 文件有以下代码

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^codeigniter.*
RewriteRule ^(.*)$ /index.php?/$1 [L]

#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^uz\-mi.*
RewriteRule ^(.*)$ /index.php/$1 [L]

#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|css|style|uploads|js|robots\.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
  </IfModule>

  <IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin

   ErrorDocument 404 /index.php
  </IfModule> 

  RewriteCond %{HTTP_HOST} ^encg\.ae$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.encg\.ae$
  RewriteRule ^/?$ "http\:\/\/www\.abc\.com\/encg" [R=301,L]

  RewriteCond %{HTTP_HOST} ^ncg\.ae$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.ncg\.ae$
  RewriteRule ^/?$ "http\:\/\/www\.abc\.com\/encg" [R=301,L]
4

1 回答 1

0

您可以将一个新的简单.htaccess文件添加到具有“NOP”内容的 ems2 项目文件夹,以停止处理.htaccess来自父文件夹的文件。

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
</IfModule>
于 2012-12-11T07:40:12.080 回答