Page 1 of 1

root folder

PostPosted: 02. February 2009 04:39
by TheTitans
I have a folder for my website that is stored in the htdocs folder. When I code, I usually put in the forward slash in front of all my links.

Example:
Code: Select all
<img src="/images/banner1.png" alt="" width="343" height="187" /><img src="/images/bannertxt.png" alt="" width="329" height="187" />


However, the images and links don't work because there is no 'images' folder in the htdocs folder. The 'images' folder is in the htdocs/website folder. So I kind of want to make the website folder root directory. What are my options here?

Re: root folder

PostPosted: 02. February 2009 07:32
by Izzy
TheTitans wrote:I have a folder for my website that is stored in the htdocs folder. When I code, I usually put in the forward slash in front of all my links.
Example:
Code: Select all
<img src="/images/banner1.png" alt="" width="343" height="187" /><img src="/images/bannertxt.png" alt="" width="329" height="187" />
However, the images and links don't work because there is no 'images' folder in the htdocs folder. The 'images' folder is in the htdocs/website folder. So I kind of want to make the website folder root directory. What are my options here?
Then use relative paths not absolute paths - see here:
viewtopic.php?f=16&t=19590

See this: Google search for definitions of relative and absolute paths.
Or this: Google search for relative paths in php.

Or create a VirtualHost for your website in the httpd-vhosts.conf file but relative not absolute paths may still apply.