base_url() and site_url() not working in live server [closed]

Things working on localhost and not working on live linux hosts is 99% due to case of controller names , paths etc.

When you develop on Windows or MACs, they don’t care about case. Linux does.

So if your Live Host is linux based…
Your welcome controller should be lower case in the URL.

As an aside: It’s generally normal to use lowercase for naming methods ie insert_value or camel case insertValue. But that shouldn’t be a show stopper – it’s more a coding style convention. CI recommends lowercase using underscores for word separation ie insert_value.

<?php echo base_url();?>index.php/welcome/InsertValue

Where your Welcome Controller name in the URL is welcome (All Lowercase) and NOT Welcome.

Plus always LOOK at the generated Links etc in your Pages Source to make sure it looks ok! From your browser. That’s usually a Right Mouse Click – View Source (dependant upon the browswer you are using ). Or you can F11 and view the source in the Panel or Right Click Inspect Element… You need to know how to Look at what’s being generated and to try things out when you get stuck.

Hope that helps.

Leave a Comment