Jump to content

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.

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.