[thelist] Apache moved root directory

sbeam sbeam at syxyz.net
Fri Mar 12 06:39:16 CST 2004


On Friday 12 March 2004 03:01, fstorr wrote:
> I'm trying to get Apache to serve documents from a subdirectory that
> I want it to treat as the site root.  For instance, all root relative
> links:
>
> /index.php
>
> I'd like to be rewritten
>
> /mysite/index.php
>
> Agh - I forgot to mention - I need an .htaccess solution for this.
> Sorry!

I don't think there is one (or if there is its extremely ugly). If you 
do a
RewriteRule (.*) /mysite$1
then you have just created an infinite loop. Same with an external 
redirect. This is really what the DocumentRoot directive is for which 
can't go in a .htaccess for obvious reasons. Just get your admin to 
change the DocumentRoot or set up a new vhost for /mysite/

Or better yet 
# cd realwebrootdir; mv mysite/* .
;)
hth

--

# S Beam - Web App Dev Servs
# http://www.onsetcorps.net/


More information about the thelist mailing list