homepage Welcome to WebmasterWorld Guest from 54.161.185.244
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
Forum Library, Charter, Moderators: bakedjake

Linux, Unix, and *nix like Operating Systems Forum

    
Setting up document root folders
acemaster

5+ Year Member



 
Msg#: 3871079 posted 2:04 am on Mar 16, 2009 (gmt 0)

Hello

I am looking to set up subfolders in my localhost as document roots.

ex:

[localhost...]

can be accessed from a alias called 'subalias' via

[subalias...]

How can this be done? If there is a lot involved, can someone point me to a tutorial on how to do this?

 

acemaster

5+ Year Member



 
Msg#: 3871079 posted 9:09 pm on Mar 16, 2009 (gmt 0)

To simplify the question, I want to be able to set up a subfolder as a root directory.

So when I am including images through css, I can use

url("/images/image.jpg")

instead of

url("/subfolder/images/image.jpg")

Any ideas?

encyclo

WebmasterWorld Senior Member encyclo us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3871079 posted 11:51 pm on Mar 16, 2009 (gmt 0)

I assume you're using Apache? If so, then you need to set up the appropriate (usually name-based) VirtualHosts in httpd.conf, defining the appropriate document root for each:

[httpd.apache.org...]

I'm not a fan of placing subdomains or add-on domains as subdirectories of a primary host, as it can complicate management of any redirects and such as any rules for the primary domain risk cascading down to the subdomains. You would be better preparing separate document roots for each domain, maybe with common content defined via an Alias [httpd.apache.org]. On a Linux/Unix server, you can use a user directory for each domain instead.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Linux, Unix, and *nix like Operating Systems
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved