Virtual sites with links and stylesheets
Posted by: P15 (---.range86-180.btcentralplus.com)
Date: April 02, 2010 12:03AM

Hi all,
I am having a problem with my virtual sites with links and stylesheets. For example I have a site located at C:\wamp\www\cuosc

Within the webpages I use PHP includes for the header and navigation - the links and stylesheets are therefore set as following which work fine on my live site:

link rel="stylesheet" href="/styles/screen.css
a href="/news/index.php

However when I go to [localhost] it can't find the stylesheet and the links are all [localhost] rather than [localhost]

I have done the following:

1. Created the folder C:\wamp\www\cuosc
2. Created the folder C:\wamp\www\cuosc\logs


3. Edited C:\wamp\bin\apache\Apache2.2.11\conf\httpd.conf to:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf

4. Edited C:\wamp\bin\apache\Apache2.2.11\conf\extra\httpd-vhosts.conf to:
NameVirtualHost *:80

<VirtualHost *:80>
ServerName cuosc
DocumentRoot C:/wamp/www/cuosc
ErrorLog "C:/wamp/www/cuosc/logs/error.log"
CustomLog "C:/wamp/www/cuosc/logs/access.log" common
</VirtualHost>

<VirtualHost *:80>
ServerName localhost
DocumentRoot C:/wamp/www
ErrorLog "C:/wamp/www/logs/error.log"
CustomLog "C:/wamp/www/logs/access.log" common
</VirtualHost>

5. Edited C:\Windows\System32\drivers\etc\HOSTS to:

127.0.0.1 localhost
127.0.0.1 cuosc

Any help would be appreciated - I'm sure I'll have missed something obvious but this is completely new to me so apologies in advance if it is!

Cheers.

Options: ReplyQuote
Re: Virtual sites with links and stylesheets
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: April 02, 2010 12:55AM

If you created a virtual host you need to go to [cuosc] instead of [localhost]

Options: ReplyQuote
Re: Virtual sites with links and stylesheets
Posted by: P15 (---.range86-180.btcentralplus.com)
Date: April 02, 2010 01:14AM

c2dan thank you so much :-)

I went to localhost and then clicked on the 'Your Aliases' link which took me to [localhost] but going to [cuosc] works fine.

Appreciate your help and fast response.

Options: ReplyQuote


Sorry, only registered users may post in this forum.