bayburt
bayburt

Reputation: 117

500 internal server error .htaccess codeigniter

ı have a website that using codeigniter, it was working great, but ı need to format pc. ı installed windows 7 64 bit.

and then

ı pasted my project back to www directory and now ı get this error. ı dont change any code or something. ı just formatted my pc. .htaccess was working ı didnt change it.

ı am working on localhost, ı dont change any think and ı dont know why it happened. please help me ı have to solve it.

full error:

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

Please contact the server administrator, admin@localhost 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.

my .htaccess

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

Upvotes: 1

Views: 10579

Answers (3)

ravi
ravi

Reputation: 1

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] 

Upvotes: 0

bayburt
bayburt

Reputation: 117

ı found the solution, thank you guys.

if you want to use htaccess you have to enable it on wampserver.

servivec section.

Upvotes: 0

Matt Urtnowski
Matt Urtnowski

Reputation: 2566

Use this to check to see if mod-rewrite is working. If it is not working you will get an 404 page instead of internal server error 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>

The IfModule checks to see if the module is available. You can find a wiki entry on mod-rewrite and codeigniter here http://codeigniter.com/wiki/mod_rewrite

If you see the 404 error you need to enable mod-rewrite. If you still see the 500 error something else is wrong.

Upvotes: 4

Related Questions