【发布时间】:2014-01-07 15:26:01
【问题描述】:
我已经研究了有关 stackoverflow 的所有问题,以从 codeigniter 中删除 index.php,但我仍然无法做到。只有登录页面打开,但其余页面为空白。
我正在使用自己的ubuntu linux 服务器。
我的重写模块也打开了。我用所有可能的值尝试了$config['uri_protocol']。 AUTO, PATH_INFO, QUERY_STRING, ORIG_PATH_INFO。
我的 htaccess 代码在这里
RewriteEngine on
AddType text/x-component .htc
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
vhost 文件在这里
DocumentRoot /home/black-sheep/black-sheep.org
<Directory />
Options FollowSymLinks
AllowOverride FileInfo
</Directory>
<Directory /home/black-sheep/black-sheep.org/>
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog /var/log/apache2/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog /var/log/apache2/access.log combined
我的网址是
http://black-sheep.org/
这是我在 index.php 上回显 __FILE__ 时的路径
/home/black-sheep/black-sheep.org/index.php
令人惊讶的是,在没有 index.php 的同一台服务器上的 wordpress 站点在遵循 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
我也尝试过使用这个 htaccess,但它对我不起作用。
请给我建议解决方案。 在此先感谢
【问题讨论】:
-
是否启用了 mod_rewrite ?
-
是的……我确定……
标签: php .htaccess codeigniter ubuntu