Jump to content

Absolute URL paths


BluegrassLass

Recommended Posts

Howdy all!  PHP newbie here =)  (I'm sure yall get that alot....)

 

I feel silly asking this as I know the answer must be simple.  Not even entirely sure its within the realm of php and not html....I've done plenty of searches but am getting way too many unhelpful results and am not sure what keywords to use to narrow it down.

 

Okay...I have a 150+ page website I'm converting to html's with php includes (via htaccess).  One of the php includes is a side navigation pane with (of course) tons of links to pages within my site.  I also have several directories.  My includes are all in a folder "includes" in the main public_html directory......I refer to them from any page in the site using ($_SERVER["DOCUMENT_ROOT"] . "/includes/header.php") (example).  Is there a way to refer to links in a similar fashion?  I know about absolute and relative URL's of course....but I need to be able to move and upload these files to different servers and use on my own apache server.....so I'm looking for a way to use "absolute urls" based on the document root (or something comparable) and not the entire http path.

 

Again - I know this must be simple.  Please forgive my ignorance =)  Thanks in advance for any help or direction.

Link to comment
Share on other sites

Thank you kindly!

 

However, I've tried a variety of different formats and cannot get it to work (even after trying formats others have eventually found to work for them).  Is there a particular format I need to use?  Is there something I need to have configured in a particular fashion?

Link to comment
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.