2012-12-11 194 views
0

我有一個在根文件夾上運行的codeigniter項目。在名爲ems2的文件夾中的同一臺服務器上,另一個項目正在運行。但是由於codeigniter項目的根.htaccess,ems2項目不起作用。我如何從ems2文件夾中刪除.htaccess控件?根.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] 
+0

你在'ems2'目錄下有一個htaccess文件嗎? –

+0

沒有。它是一個簡單的php項目包含在這個文件夾中 – user1023242

回答

0

您可以將新的,簡單的.htaccess文件添加到EMS2的項目文件夾有「NOP」內容停止處理從父文件夾的.htaccess

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteBase/
</IfModule> 
相關問題