Jump to content

Subdomain index.php getting file from entire sites root folder w/o absolute path


visualazza

Recommended Posts

I was wondering of it was possible to have a file say style.css in the root folder of a site like www.example.com/style.css and then get a subdomain called www.sub.example.com which points to www.example.com/subarea to get that file without the use of absolute paths?

 

Sorry if its not clear.

Link to comment
Share on other sites

The file style.css will be requested by your HTML (or specifically your web browser), not PHP. So you'd use a url

<link rel="stylesheet" type="text/css" href="http://example.com/style.css" />

No matter what the url is it will request for correct file each time.

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.