Jump to content

Recommended Posts

why would you not add the full url of a link

 

<a href="http://www.mySite.com/viewProfile.php">

 

instead of

 

<a href="viewProfile.php">

 

I understand that the second link is relative to where you are, however is it slower to go to a link that is the full url?... thanks to any responders.

Link to comment
https://forums.phpfreaks.com/topic/130577-link-type/
Share on other sites

For one it helps if you plan on changing domains or do.

 

If your script generates links in http://xxxx.com/script.php format and you change your domain to yyyy.com, you would have to update every single place the script links.

 

 

Exactly.  If you're writing your own library or framework, relative paths make it far easier to keep things portable and extensible.

 

As a matter of immediate practicality, it also saves on a decent amount of typing, which I appreciate.

Link to comment
https://forums.phpfreaks.com/topic/130577-link-type/#findComment-677458
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.