Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8214127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:21:13+00:00 2026-06-07T11:21:13+00:00

so basically when i echo the codeigniter function base_url() in the href attribute of

  • 0

so basically when i echo the codeigniter function base_url() in the href attribute of an anchor tag, it appears to echo it out twice. Example:

<a href="<?php echo base_url(); ?>">somelink</a>

and the above, if you inspect it your chrome browser shows this:

<a href="www.mysitedomainname.com/www.mysitedomainname.com/">somelink</a>

“mysitedomainname.com” is just a name i made up for this example. Any reason why this is happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T11:21:16+00:00Added an answer on June 7, 2026 at 11:21 am

    There are three reasons I’m aware about that can cause this.

    The first one is when something wrong is written in config.php on line 17 $config['base_url'] = ''; – it better be left empty, just like when you download CI.

    The second one is if you have set $config['base_url'] value to something without prefixing it with http:// or other protocol.

    The third one is if you have set base href somewhere:

    <base href="http://www.mysitedomainname.com/" />
    

    When you need to link to some other page, you should use site_url(), base_url() can be used to link stylesheets, js, img src attributes and other real URL’s. The reason is pretty simple, base_url() does not include the index_page value set in config.php.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is basically all I'm doing echo @file_get_contents(http://******.org/ti.php?i=.$i.&s=.$s); But when I remove the ti.php
I´m coming from a PHP background where my debugging tools are basically echo ,
Basically, i would like to echo out something along the lines of <p style=color:FFFFFF>
Basically I have two ways for writing something First: <?php echo link_to( static_image_tag( $object->getImageWebPath(),
Basically what I'm wanting is my datepicker to echo out the month that it
Basically, I'm trying to implement the following: echo asdf | ./a.out where ./a.out simply
Basically it's just: success: function(msg){ alert(msg); } What comes out alert´s. But is it
Basically from C++ FAQ I learned that: A virtual function allows derived classes to
I'm learning Ajax at the moment. The code below basically receives the echo from
Basically I just want to strip out a part of my smarty variable contents.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.