我是新的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