0

I have two parts to a site, foo.domain.com and bar.domain.com (with bar.domain.com really being a CNAME to another host) I want users entering www.domain.com to be redirected to bar.domain.com. That is a simple redirect, no problem.

However I also want to be able to access subfolders of www.domain.com, is there a way the .htaccess file can be configured for this?

1 Answer 1

2

This is a simple redirect. The only trick is that Redirect acts on a prefix, so you couldn't use it to match only / on its own. RedirectMatch does not have that limitation.

RedirectMatch permanent ^/$ http://bar.domain.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.