root folder

Problems with the Windows version of XAMPP, questions, comments, and anything related.

root folder

Postby TheTitans » 02. February 2009 04:39

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?
TheTitans
 
Posts: 5
Joined: 04. February 2008 04:53

Re: root folder

Postby Izzy » 02. February 2009 07:32

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.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06


Return to XAMPP for Windows

Who is online

Users browsing this forum: Gharas and 61 guests