Sign up ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I know this may seem a bit of a question in reverse, but I actually don't seem to have a problem I just want to make sure before I proceed.

I have 2 domains and and a directory my_directory at

I have setup as an "add on domain" in the cpanel account of so that when I go to I am taken to but the browser shows in the addressbar so it looks and acts like and is a separate site.

However when people browse to I want the address bar to show not So I put a redirect in the htaccess file to redirect to and it works perfectly, but I think it shouldnt and I'm worried I've done something wrong.

My question is this: was already redirected to in the first place (I see the redirect in my cpanel under addon domains) so by adding the second redirect in the htaccess file I should be creating a loop!

Could somebody please set my mind at rest and show me why not?

share|improve this question

migrated from Jun 25 '11 at 10:21

This question came from our site for professional and enthusiast programmers.

nice edit jeff you make it seem so easy !! – byronyasgur Jun 30 '11 at 0:06

1 Answer 1

up vote 1 down vote accepted

You are using 2 different mechanisms.

You have a redirect so that when someone visits they are redirected to

You have a rewrite so that when someone visits they actually see the content from This is processed internally within apache. It is not processing the redirect rule.

share|improve this answer
thanks - that would make sense but cpanel calls it (under addon domain) a redirect not a rewrite could this be a bit erroneous that would explain it – byronyasgur Jun 24 '11 at 14:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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