Jump to content

VirtualHosts not acting as desired.


Go to solution Solved by requinix,

Recommended Posts

I have recently restructed my local web server and implemented VirtualHosts for using a subdomain. Currently the public_html is the directory for my domain and dev.domain.com lands in the dev directory, this is all working correctly. however, when I am working in my index.html in the dev directory and call for layout.css which is in static, it retreived the layout.css from the static folder in public_html/ and not the static directory in dev. How can I get around this issue? I have included the directory structure before if that helps. Sorry if my wording for explaining this is confusing.

 

-root

--public_html

---static

---etc

--subdomains

---dev

----static

----etc

---fate

 

Is the block in the vhost conf

NameVirtualHost *:80
<VirtualHost *:80>
    serverName domain.com
    DocumentRoot "E:\root\public_html"
</VirtualHost>


NameVirtualHost *:80
<VirtualHost *:80>
	ServerName dev.domain.com
	ServerAlias dev.domain.com
	DocumentRoot "E:\root\subdomains\dev"
	<Directory "E:\root\subdomains\dev">
		AllowOverride All
		order allow,deny
		Allow from all
	</Directory>
</VirtualHost>
Edited by Braxton
Link to comment
https://forums.phpfreaks.com/topic/277359-virtualhosts-not-acting-as-desired/
Share on other sites

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.