我是新的codeigniter,而重定向一个页面index.php默认情况下不加载,所以我已经尝试在htaccess文件中的下面的代码。我已经安装了PHP 5.3.10,apache服务器和postgres数据库。所以如果除了更改.htaccess和httpd.conf之外还有其他新的配置,请让我知道。我曾经看到过有关同一问题的问题,我提到了这些问题的所有内容,但仍然无法解决这个问题。请让我知道还有什么额外的事情要做。在codeigniter重定向不工作没有index.php?
.htaccess文件
<IfModule mod_rewrite.c> RewriteEngine On #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 #This last condition enables access to the images and css folders, and the robots.txt file RewriteCond $1 !^(index\.php|public|images|robots\.txt|css) RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^/(index\.php|assets/|humans\.txt) RewriteRule ^(.*)$ index.php/$1 [L]
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
httpd.conf文件 服务器名本地主机
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
这可能会帮助http://stackoverflow.com/questions/20188957/removing-index-php-offical-guide-not-working-code-igniter?rq=1 – Pooshonk 2014-09-26 08:27:45
重写模块是否启用? – lyhong 2014-09-26 08:52:54
确保'application/config/config.php'中的'$ config ['index_page'] =';;' – 2014-09-26 09:12:57