0

I had developed a website using Codeigniter. It was working good in localhost. When i hosted it and clicked on links i get "Internal Server Error".

Also i'm not able to see .htaccess files. Please tell me what i'm missing.

Works perfectly

Localhost:

$config['base_url'] = 'http://localhost/site/';

<a href="<?php echo base_url('welcome/page') ?>"> Welcome </a>

When clicked above link, it goes to below url and works perfectly

http://localhost/site/welcome/page

Hosted

Public Web Server (Error):

$config['base_url'] = 'http://www.mysite.com/';

<a href="<?php echo base_url('welcome/page') ?>"> Welcome </a>

When clicked above link, it goes to below url and gives an error

http://mysite.com/welcome/page
3
  • try loading this url on hosted server http://mysite.com/index.php/welcome/page If it works then, you haven't enabled rewrite module on server for htaccess to properly work..I can explain that if needed Commented Oct 30, 2013 at 15:51
  • Check on your htaccess file if you have included the site/ part of the mod_rewrite to avoid the index.php/. If you find it, then remove it Commented Oct 30, 2013 at 20:12
  • if your site is hosted on IIS then you will need web.config file instead of .htaccess Commented Oct 31, 2013 at 9:49

2 Answers 2

1

If you have access to the Apache error logs check those for why you are getting the 'Internal Server Error.'

On a Linux server those are usually found in '/var/log/apache2/error.log.'

On a Windows server they can by default be found in something like 'C:\Program Files\Apache\logs.' Or you can find out the location by looking in the conf file or virtual hosts conf file if you use that.

Sign up to request clarification or add additional context in comments.

Comments

0

try

<a href="<?php echo site_url('welcome/page') ?>"> Welcome </a>

see docs http://ellislab.com/codeigniter/user-guide/helpers/url_helper.html

OR to hide index.php

add .htaccess file

<IfModule mod_rewrite.c>
  RewriteEngine on
  RewriteCond $1 !^(index\.php)
  RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.