logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Changing Document Root
Author
sadkinso



Joined: 07 Apr 2007
Posts: 1
Location: Oregon

PostPosted: Sat 07 Apr '07 3:16    Post subject: Changing Document Root Reply with quote

Hello there,

I'm doing a website hosting project for my senior project in college, and I need some help. I want to allow people to register and create (or upload) a website that I host, and I want their site to be accessed two ways.

I already have virtual hosts working, so that "www.theiraddress.com" can be forwarded to my server, and change the document root. This is one way to access their website.

But if they don't have a registered domain, or don't want to forward it to me, I want them to be able to access their website with "www.collegehost.net/~username".

Here's the problem. Using UserDir, I can get the server to open up the folder where their files are, the same folder that is set to document_root in virtual hosts. But if they access their site this way, then anything that uses the document_root for directory location (for example <img src="/images/logo.gif" >, they get the document_root for my hosting website, collegehost.net, and thus, it goes into my images folder.

Is there anyway that I can use UserDir, and have the document_root change along with it. Or does anyone have any advice as to a better way to do this than the way I am doing it?

Any tips will be most appreciated. Thanks very much everyone!

- Sean
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Fri 20 Apr '07 17:02    Post subject: Reply with quote

The easiest solution is to tell people creating relative paths in their html

like <img src="images/img.jpg" that would work on both ~username and domain.
Back to top


Reply to topic   Topic: Changing Document Root View previous topic :: View next topic
Post new topic   Forum Index -> Apache