我已經在windows server 2008 R2上安裝了PHP,Mysql和Apache,正如this link所提供的。CodeIgniter正常安裝Apache 2.4後刪除index.php與htaccess 2.4
它的工作就像一個魅力,但問題是我的.htaccess
刪除index.php
。
我.htaccess
文件包括以下內容:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /HR/ #Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#When your application folder isn't in the system folder
#This snippet prevents user access to the application folder
#Submitted by: Fabdrol
#Rename 'application' to your applications folder name.
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
#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
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
我已經在Apache中啓用mod_rewrite
。但我得到500內部服務器錯誤。
注:在文檔根改變AllowOverRide All
時None
喜歡這裏:
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
的500 internal error
消失,但.htaccess
不起作用!那麼我應該添加index.php
的鏈接工作。
注:當AllowIverRide All
我得到這個錯誤:
[Tue Feb 19 18:20:10.988018 2013] [core:alert] [pid 3940:tid 844]
[client 127.0.0.1:49513] C:/Apache24/htdocs/HR/.htaccess:
RewriteBase takes one argument, the base URL of the per-directory context
任何幫助將不勝感激。 TY。
您是否編輯config.php並將config ['index_page']更改爲等於「」?如果仍然說「index.php」,可能是你的問題。 – 2013-02-19 15:12:54
如果您刪除了'RewriteBase/HR /',並且還刪除了所有'index.php'實例前面的正斜槓,會發生什麼? – Mudshark 2013-02-19 15:22:14
@DevinYoung是的,我沒有刪除它.. – 2013-02-19 15:22:56