PDA

View Full Version : mod_rewrite confusion



Bob_123
02-04-2007, 07:50 PM
I'm confused and would greatly appreciate some guidance on properly setting up mod_rewrite in my .htaccess file.

I have the following directory structure and web sites respectively:
site_1_dir: "public_html/WMF " (my primary domain subdirectory)
site_1: "www.wmf.com/WMF/"
site_2_dir: "public_html/mmf" (a subdomain of the above)
site_2: "www.mmf.com"

I want site_2 to redirect to site_1 transparently. (That is, when the address of site 2 is used I want to execute the code in site 2. I want this to be transparent such that the site 2's address is displayed.)

Here's my last attempt....

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.wmf\.com$
RewriteRule ^(.*)$ http://www\.wmf\.com/WMF/$1 [L]

Thank you in advance,
Bob

Pethens
02-04-2007, 08:41 PM
I believe that's not possible (mod_rewrite experts correct me if I'm wrong): every addon domain and subdomain is at the top of a separate hierarchy so the only way you can move between them is with an external redirect.

However, I'm not sure you really need to use a redirect. The situation you are describing could be handled by making www.mmf.com a parked domain which points to www.wmf.com. But your post is a little confusing so I may have misunderstood what you are trying to do. Does that help or do you want to clarify?