2012-04-20 196 views
1

我有一个网站,使用codeigniter,它工作很好,但我需要格式化PC。我安装了Windows 7 64位。500内部服务器错误.htaccess codeigniter

然后

我粘贴我的项目回www目录,现在我得到这个错误。 ı不要更改任何代码或其他东西。我只是格式化了我的电脑。 .htaccess工作ı没有改变它。

我在本地主机上工作,我没有改变任何想法,我不知道为什么发生。请帮我ı必须解决它。

完全错误:

The server encountered an internal error or misconfiguration and was unable to complete your request. 

Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. 

More information about this error may be available in the server error log. 

我的.htaccess

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /blogna/index.php/$1 [L] 
+0

1.检查Windows防火墙 2.卸下并重新进行添加C.I. – 2012-04-20 02:22:47

+1

查看apache日志以获取更多详细信息。 – scalopus 2012-04-20 02:26:10

+0

错误日志将包含错误的确切详细信息。你在浏览器中看到的是故意模糊的,以防止内部配置细节泄露。 – 2012-04-20 02:59:50

回答

4

使用此功能来检查,看看是否国防部重写工作。如果它不工作,你会得到一个404页面,而不是内部服务器错误500

<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ /blogna/index.php/$1 [L] 
</IfModule> 

<IfModule !mod_rewrite.c> 
ErrorDocument 404 /index.php 
</IfModule> 

的IfModule检查是否模块可用。你可以在这里找到mod-rewrite和codeigniter的wiki条目http://codeigniter.com/wiki/mod_rewrite

如果你看到404错误,你需要启用mod-rewrite。如果您仍然看到500错误,则说明其他错误。

+0

我尝试了很多这样的东西,但这是唯一对我有用的东西....非常感谢。你能解释一下你的意思吗? Ruwantha 2013-04-13 15:25:46

+0

@Ruwantha它检查mod_rewrite模块是否已加载并由Apache使用。如果apache没有启用mod_rewrite然后显示Error404 – Murtnowski 2013-04-13 16:27:01

+0

然后在IfModule mod_rewrite.c是应该工作...不应该?因为如果在我的虚拟主机成为真实的...但是当它不在那里它不工作 – Ruwantha 2013-04-13 16:36:46

0

我找到了解决方案,谢谢你们。

如果您想使用htaccess,您必须在wampserver上启用它。

servivec部分。

0
DirectoryIndex index.php 

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA] 
相关问题