httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex List <>
Subject [users@httpd] mod_rewrite to hide subdirectory
Date Mon, 07 Jul 2008 05:14:20 GMT

I need to hide an embedded directory in a URL  
<-- need to remove that and just see for the files in / 

Here's a visual representation of my file system.
Document root:
-site2folder/ (Important!)
-functions/ ::need to be accessed by site2 --if it wasnt auto re-routed to /site2folder/
Document root:
-functions/ ::need to be accessed by site2
-file and both point to the same server.
I can't use virtual servers or mod_rewrite document root because I  
need the documents in accessible by
I have requests for rerouting to site2folder/ using php  
header("Location: and $_SERVER
I don't want my users to see I want them to see and still access the files in /site2folder/. I was thinking  
mod_rewrite but I'm terrible at that..
Again I want to pretend like the directory doesn't exist and just use  
the top-level domain.

--I found this online and it DOESN'T work
Am I doing something wrong?

RewriteCond %{HTTP_HOST} ^(w{1,3}\.)?site2\.com$
RewriteCond $1 !^site2folder/
RewriteRule (.*) /site2folder/$1 [L]


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message