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  :)

  • 4 years later...

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.