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 8841643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:46:17+00:00 2026-06-14T10:46:17+00:00

When I have a link like http://site.com , clicking it goes to that URL

  • 0

When I have a link like http://site.com, clicking it goes to that URL just fine.

But when the link is just www.site.com, it adds this URL to the parent website and consequently does not go to the URL.

So, clicking on <a href='www.site.com'>site</a> creates this in the browser taskbar: www.parentsite.com/www.site.com.

How can I fix this without using preg_replace? I am fairly new to this game.

  • 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-14T10:46:18+00:00Added an answer on June 14, 2026 at 10:46 am

    Because www.parentsite.com is interpreted as a relative address, like for example index.htm, as opposed to an absolute URL which consists of protocol, hostname, and path.

    When I’m on example.com‘s front page….

    • contact.html is a relative address, the absolute end result will be http://example.com/contact.html (the browser does this as an internal calculation)

    • images/ is a relative address, resulting in http://example.com/images/

    • www.xyz.com results in http://example.com/www.xyz.com

    You need to prefix the protocol (eg. http://) to make the browser understand that you mean a full URL, and treat it accordingly.

    Here’s a background info article on the issue on MSDN.

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

Sidebar

Related Questions

If I have a link of a picture like that: http://www.google.com/images/srpr/logo3w.png Can I retrieve
Okay.. so basically, say we have a link: $url = http://www.site.com/index.php?sub=Mawson&state=QLD&cat=4&page=2&sort=z; Basically, I need
So basically I have a very long url, something like this - http://www.site.com/wp-content/themes/theme/timthumb.php?src=/wp-content/uploads/2012/random-image-name.jpg&w=650&h=0&zc=1&q=100 and
I have a link which looks like that: www.domain.com/file.php I want to create .htaccess
I have a sitemap with many urls. Something like: <url> <loc> http://site.com/ </loc> <priority>
We have an url like http://site.com/people/593765-barack-obama?sort=popular How do I get only the ID part
i have multiple strings containing a link like: <A HREF=http://www.testings2>testings2</A> <A HREF=http://www.blabla>blabla</A> <A HREF=http://www.gowick>gowick</A>
I have a link, let's say: http://site.com/profile.php?id=1 ....In a normal mode, with a normal
i have an asp.net-mvc site and one of the pages is http://www.mysite.com/Report users can
I have a site like: http://*mysite.com/search/ in it index.php is generating History.pushState() for history.js

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.