Michael Ayo Lee
Michael Ayo Lee

Reputation: 1

Site shows 500 internal error when after installation

I installed a php script on my 1and1 web server but it shows a 500 internal sever error but when index.php is included to the url it loads the normal index.php homepage. the url is http://my.gsix.com.ng/ but when it is typed this way http://my.gsix.com.ng/index.php it then loads the normal homepage.

I also discovered that it loads well when i first installed it on my localhost before the web server.

EDIT:

My .htaccess file

RewriteCond $1 !^(index.php|assets|images|js|css|uploads|favicon.png|install|sitemap.xml|robots.txt) 
RewriteCond %(REQUEST_FILENAME) !-f 
RewriteCond %(REQUEST_FILENAME) !-d 
RewriteRule ^(.*)$ index.php?/$1 [L]

Upvotes: 0

Views: 54

Answers (2)

mooga
mooga

Reputation: 3317

You need to add .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.+$ /index.php [L]

Explaining :

This enables the rewrite engine:

RewriteEngine on

This checks for existing folders (-d) and files (-f):

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

And this does the actual redirecting:

RewriteRule . index.php [L]

This will redirect every query to the root directory's index.php

Upvotes: 0

getl0st
getl0st

Reputation: 342

That means that the php script contains some error, try this on top of the script

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

And it will show you the errors you need to fix.

You can try to remove the .htaccess ( it may be redirecting to a page that doesnt exist )

Upvotes: 1

Related Questions