Jump to content

[SOLVED] Resolving local host path and domain path?


jobs

Recommended Posts

I'm trying to figure out how to resolve an issue with paths.

On my development computer, I load my home page like this:

http://localhost/hhs/index.php

 

On my server, I don't use the "localhost/hhs, so on the server the files are located up one folder in the tree.

 

In development, I can access a file by "hhs/lib/myfile.php" but on the server this does not work.  It must be changed to "lib/myfile.php"

 

I have tried what seems to be every combination of $_SERVER[HTTP_HOST] and __FILE__, but nothing is working. Please help!

this works..

<link rel="stylesheet" type="text/css" href=" <?php echo 'lib/css/site.css'; ?>" media="all" />

 

This will not work...

<link rel="stylesheet" type="text/css" href="<?php echo $myRoot.'lib/css/site.css' ; ?>" media="all" />

I have tried defining $myRoot as DOCUMENT_ROOT, HTTP_HOST, dirname(__FILE___) but none will load css file.

 

Any ideas? THanks.

 

Seems like this would be any easy task to accomplish.

 

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.