I recently uploaded my codeigniter project onto my web server.
it’s in a folder called project1 this is what my directory view looks like
[www.myurl.com]
|-> project1
|-> application
|-> css
|-> images
|-> js
I am having two problems.
The first is that I want it to load my welcome view when I go to (www.myurl.com) and not
(www.myurl.com/project1/main_controller/index.php/welcome). How do i get rid of all that garbage?
The second problem is when I use <?php echo base_url();?> it shows up fine in view source but when I click on it, it echo’s the url [www.myurl.com/project1/www.myurl.com/project1/] why is it doing this?
It looks like you’ve installed CodeIgniter into a subdirectory. If you want your CI site to load from the root url, you should copy it one directory up so the Application & System folders are directly under the root url of your web directory. From there, the .htaccess rules that are posted by shail (and quoted below) should take care of removing the index.php in your paths.
Regarding the site_url() issue, make sure you have your $config[‘base_url’] variable set in application/config/config.php and that it contains the trailing slash.
To test this further, try passing a parameter to the site_url() function like this:
Which should return: http://www.myurl.com/welcome if everything is set right.