【发布时间】:2011-12-07 23:29:38
【问题描述】:
我有一个 Codeigniter 2.1 安装在我的本地测试服务器 (XAMPP) 上正常工作,但是当我将它移动到我的网络解决方案主机上的测试子域时,我无法获取 .htaccess 来删除 index.php。我已尝试将重写路径为“/htdocs/test”和/test,但仍然出现以下错误:
内部服务器错误
服务器遇到内部错误或配置错误,无法完成您的请求。
请联系服务器管理员,[未提供地址],并告知他们错误发生的时间,以及您所做的任何可能导致错误的事情。
服务器错误日志中可能会提供有关此错误的更多信息。
此外,在尝试使用 ErrorDocument 处理请求时遇到 500 Internal Server Error 错误。
<IfModule mod_rewrite.c>
SetEnv APPLICATION_ENV development
RewriteEngine On
RewriteBase /test
#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]
#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
#Submitted by Michael Radlmaier (mradlmaier)
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
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>
我的子域位于 /htdocs/test
谢谢!
【问题讨论】:
-
你试过
RewriteBase /吗? -
您能粘贴错误日志中的消息吗?
标签: .htaccess codeigniter