简体   繁体   English

.htaccess控件从文件夹中删除

[英].htaccess control remove from a folder

I have a codeigniter project running on root folder. 我有一个在根文件夹上运行的codeigniter项目。 In the same server on a folder called ems2 another project is running. 在同一服务器上的ems2文件夹中,另一个项目正在运行。 But because of the root .htaccess of codeigniter project, the ems2 project is not working. 但是由于codeigniter项目的根.htaccess,ems2项目无法正常工作。 How can I remove .htaccess control from ems2 folder? 如何从ems2文件夹中删除.htaccess控件?

My .htaccess file on root has following code 我在根目录上的.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]

You can add a new, simple .htaccess file to the ems2 project folder with a "NOP" content to stop processing the .htaccess from the parent folder. 您可以将新的简单的.htaccess文件添加到带有“ NOP”内容的ems2项目文件夹中,以停止处理父文件夹中的.htaccess

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteBase /
</IfModule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM