Jump to content

Converting a relative url to an absolute url?


shyguy0507

Recommended Posts

Hi,

 

I'm sorry if this has already been posted, a search of the forum didn't turn anything up so i'll ask away.

 

I'm trying to fetch urls from a document on my server and convert them into absolute urls.  I can extract them but some of my links use ../ or ./.  I think i've solved the ./ one but I can't find anything on getting the url when ../ is used.

 

As an example some urls use ../index.php when in a directory so http://www.example.com/dir/test.php, so a url of ../index.php from here would land the user on http://www.example.com/index.php.  At the moment it's landing on http://www.example.com/../index.php.

 

Any ideas?  Help would be appreciated  :)

Link to comment
Share on other sites

  • 4 years later...
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.