Hi I am using CodeIgniter 1.7.3 framework in my project. I have given URL for a link like this
base_url/index.php/admin/featuredlink/flid/11
, and when I click on this link I am getting an error like this
no input file specified.
But when I change that link to base_url/index.php?admin/featuredlink/flid/11 it works fine.
In my local system this link [base_url/index.php/admin/featuredlink/flid/11 ] works fine.
Why is this link [base_url/index.php/admin/featuredlink/flid/11] not working?
How do I get this link to work? If any one knows, please reply.
Make sure first that you are changing your
$config['base_url']from your local development address to your remote development address. This is located inapplication/config/config.php.Also make sure you’re using the right URL Helper function for your needs. Here’s what I mean:
The
site_url()function/method will always include index.php in your URIs. Here’s an example using the site namehttp://example.comas your website’s domain.<?php echo site_url('home') ?>will turn intohttp://example.com/index.php/homeWhile
base_url()function/method will always exclude index.php unless you include it. Here’s an example using the site namehttp://example.comas your website’s domain.<?php echo base_url('home') ?>will turn intohttp://example.com/homeand
<?php echo base_url('index.php/home') ?>will turn intohttp://example.com/index.php/homeKeep in mind that using these functions/methods are only effective AFTER you have properly modified your
.htaccessfile. Follow the link below to remove index.php from your URIs by modifying your.htaccessfile.Keep in mind too that this can vary from host to host in the way that it needs to be formatted, so follow up on that with your hosting service. Most usually have guides that show you how to configure this properly.
Here is the link that shows you a more in-depth difference between the
site_url()andbase_url()functions.I hope this helps!