Brian,
First, sorry to have ignored your post for so long - it seemed to be asking about things I'm weak in so I was "volunteering" others to answer.
Okay, you have two domains, abc.com and xyz.com where xyz.com's root is the xyz subdirectory of abc.com. That, of course, is specified by your httpd.conf file in the Virtual Hosts section (my weakness - but I'm learning).
Your problem is that you want to redirect abc.com requests to the xyz subdirectory (NOT a permanent redirect, though).
Let's correct your abc.com's root .htaccess first:
Code:
RewriteEngine On
# handle empty {REQUEST_URI} string
RewriteRule ^$ phpbb/index.php [L]
# handle request for index.html
RewriteRule ^index\.html$ phpbb/index.php [L]
First, I don't understand the "redirect" so I've changed it to use mod_rewrite for the redirections. Second, I've made the index.html be the START (and END) of the {REQUEST_URI} string and escaped the dot in index.html (so it will ONLY match the dot. Third, since you're already in the abc.com's root directory, I changed your absolute redirect to a relative and added the Last flag.
Requests to xyz.com should NOT be able to access this .htaccess so it should be okay.
Okay, as for your #1 request, I've added the "blank {REQUEST_URI} RewriteRule. HOWEVER, you've changed the groundrules on my by wanting to show the redirect! Okay, change both "[L]" entries to "[R=301,L]" to show the actual redirects.
Your #2 request is handled by httpd.conf as xyz.com's Virtual Host has set DocumentRoot path-to/xyz so you need do nothing more.
As you can see, you don't need to go into RewriteCond(itions) to assess {HTTP_HOST} 'cause xyz.com can't see the abc.com's root directory (where the above .htaccess is located). Of course, this changes if your host has setup xyz to go to abc's root but that's NOT what you described.
If you need to take this further, please advise:
1. Do you have access to the httpd.conf file?
2. Can you confirm that xyz.com is directed to the xyz subdirectory?
Catch you later.
Regards,
DK
Bookmarks