Jump to content

link type


jonniejoejonson

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.