从wordpress htaccess中排除目录

时间:2016-01-08 17:06:17

标签: wordpress .htaccess codeigniter

我在根目录中安装了WordPress,并使用htaccess直接将域名指向它。我还在根目录中有一个CodeIgniter应用程序。在根文件夹(public_html)中有两个htaccess文件,另一个在WordPress目录中。

我似乎无法使CodeIgniter可访问。请帮忙。

根文件夹中的htaccess:

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

# END WordPress

wordpress目录中的htaccess

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


RewriteRule . /rainoilcom/index.php [L]
</IfModule>

# END WordPress
在codeigniter目录中

htaccess

SetEnv TZ Africa/Lagos

<IfModule mod_rewrite.c>
# Turn on URL rewriting
RewriteEngine On

# If your website begins from a folder e.g localhost/my_project then 
# you have to change it to: RewriteBase /my_project/
# If your site begins from the root e.g. example.local/ then
# let it as it is
RewriteBase /recruitment/

# Protect application and system files from being viewed when the index.php is missing
RewriteCond $1 ^(application|system|private|logs)

# Rewrite to index.php/access_denied/URL
RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]

# Allow these directories and files to be displayed directly:
RewriteCond $1 ^(index\.php|robots\.txt|favicon\.ico|public|assets|css|js|images|uploads|media|swf\.swf)

# No rewriting
RewriteRule ^(.*)$ - [PT,L]

# Rewrite to index.php/URL
RewriteRule ^(.*)$ index.php/$1 [PT,L]
</IfModule>

1 个答案:

答案 0 :(得分:0)

我找到了令人讨厌的代码。 “ SetEnv TZ Africa / Lagos ”。删除它,我很好。