• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Removing index.php from url

#4
[eluser]adamfairholm[/eluser]
You don't have to change base_url to link_url, but the idea is you have them both side by side, and they are different - one has the index.php and one doesn't.

This is handy if you are linking to an image - you don't want the index.php, so you'd use:

Code:
<img >config->item('base_url');?&gt;images/my_pic.png" />

However, if you had a link, on your dev environment you need that index.php because you have no .htaccess file doing its thing. Then you'd use:

Code:
<a >config->item('link_url');?&gt;">A link to some awesome stuff</a>

When you move your project to its server where it will make its home, then you take the index.php off of link url and:

Code:
<img >config->item('base_url');?&gt;images/my_pic.png" />
<a >config->item('link_url');?&gt;">A link to some awesome stuff</a>

Are going to have the config variable replaced with the same thing.

You can easily add another config variable in Code Igniter. Right below the base url config item, just add:

Code:
$config['link_url'] = "http://yourdevenviormenturl/index.php/";

Does that make sense?


Messages In This Thread
Removing index.php from url - by El Forum - 06-30-2008, 09:09 PM
Removing index.php from url - by El Forum - 06-30-2008, 10:37 PM
Removing index.php from url - by El Forum - 06-30-2008, 10:45 PM
Removing index.php from url - by El Forum - 07-01-2008, 10:17 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.