Php

PHP – Codeigniter best base_url setting

if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) {
    $protocol = 'https://';
} else {
    $protocol = 'http://';
}

$config['base_url'] = $protocol . $_SERVER['HTTP_HOST'] . str_replace(basename($_SERVER['SCRIPT_NAME']), "", $_SERVER['SCRIPT_NAME']);
19 thoughts on “PHP – Codeigniter best base_url setting
  1. Hey there! Someone in my Myspace group shared this website
    with us so I came to look it over. I’m definitely enjoying the
    information. I’m book-marking and will be tweeting this to my followers!
    Great blog and great style and design.

  2. You actually make it seem so easy with your presentation but I find this
    matter to be actually something which I think I would never understand.
    It seems too complex and very broad for me.
    I’m looking forward for your next post, I’ll try to get the
    hang of it!

  3. Very good article! We are linking to this particularly great content on our site. Keep up the great writing.

  4. I simply could not go away your site prior to suggesting that I really loved the standard information an individual provide for
    your visitors? Is going to be again frequently in order to check up on new posts

  5. Great blog you have got here.. It’s hard to find excellent
    writing like yours these days. I seriously appreciate individuals like you!
    Take care!!

  6. I do consider all of the concepts you have offered to your post.
    They’re really convincing and can certainly work.
    Nonetheless, the posts are too short for starters.
    May just you please lengthen them a little from subsequent time?
    Thanks for the post.

  7. Excellent beat ! I wish to apprentice while you amend your site,
    how could i subscribe for a blog website? The account helped me a acceptable
    deal. I had been tiny bit acquainted of this
    your broadcast provided bright clear concept

  8. Its such as you read my mind! You seem to understand so much approximately this, like you wrote the e-book in it or something.
    I think that you simply could do with some p.c. to drive the message
    home a little bit, however other than that, that is fantastic
    blog. An excellent read. I will certainly be back.

  9. Hi, i feel that i noticed you visited my website so i got here to return the desire?.I am attempting to find things to enhance my web
    site!I assume its good enough to make use of some of your
    ideas!!

  10. I’m not sure exactly why but this site is loading incredibly slow for me.
    Is anyone else having this issue or is it
    a issue on my end? I’ll check back later and see if the problem still exists.

Leave a Reply

Your email address will not be published.