httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex List <atl...@gmail.com>
Subject [users@httpd] mod_rewrite to hide subdirectory
Date Tue, 08 Jul 2008 23:02:44 GMT
Hello,

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

Here's a visual representation of my file system.

site1.com
Document root:
-file
-file.html
-folder/
-site2folder/ (Important!)
-file
-functions/ ::need to be accessed by site2

site2.com --if it wasnt auto re-routed to /site2folder/
Document root:
-file
-file.html
-folder/
-site2folder/
-file
-functions/ ::need to be accessed by site2

site2.com/site2folder/
site2folder:
-file.html
-folder/
-file

site1.com and site2.com both point to the same server.
I can't use virtual servers or mod_rewrite document root because I  
need the documents in site1.com accessible by site2.com
I have requests for site2.com rerouting to site2folder/ using php  
header("Location: and $_SERVER
I don't want my users to see site2.com/site2folder/ I want them to see  
site2.com/ 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.

Thanks!
BTW
--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]


Alexander H. List
atlex2@gmail.com







---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message