【发布时间】:2016-01-10 06:18:59
【问题描述】:
我在根目录中安装了 WordPress,我使用 htaccess 将域名直接指向它。我在根目录中也有一个 CodeIgniter 应用程序。有两个 htaccess 文件,一个在根文件夹 (public_html),另一个在 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>
【问题讨论】:
-
请在您的问题中包含您的 .htaccess 文件的内容。
-
我到底能做什么?
-
为什么您的根 .htaccess 文件中有 WordPress .htaccess 指令? “我使用 htaccess 将域名直接指向它” - 根 .htaccess 文件中似乎没有任何指令可以执行此操作?
-
我不太明白这个问题?
-
您在子目录中安装了 WP。在该子目录的 .htaccess 文件中,您有一组用于该 WP 安装的 WP 指令,但在根 .htaccess 文件中也有一组 WP 指令 - 为什么会这样?
标签: wordpress .htaccess codeigniter