Jump to content

Site Document Root changing


JJBlaha

Recommended Posts

I have a site with no domain, and I want to build the site on the server before i transfer the domain to it.  The url to the site looks like http://sub.host.com/~mystuff/index.php and It will be http://www.mydsomain.com/index.php when i transfer the domain when it is ready.  So my question is, is there a way where i can change one spot (like in htaccess or like a base tag or something) and have the rest of the links/images work when i change that one spot?

Link to comment
https://forums.phpfreaks.com/topic/116657-site-document-root-changing/
Share on other sites

If you just include the path to the image relative to the current directory, you should not run into problems when you setup a new domain.

 

Example:

 

If I am in the root dir and it have a folder called "images," I can call any of the images simply by writing this:

<img src="images/image.jpg">

 

For other dirs, you will likely have to include a slash before the images to indicate that it is in another dir.

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.