chmod root

Active Member
Oct 18, 2006
Have a main domain setup on the account. Added an addon domain. Want the MAIN domain to redirect to another link within the same main domain. >>

it works, but it causes the addon domain to redirect to that link also. It should now.

I have tried this:

Redirect permanent /index.html

It caused the addon and subdomains to redirect as well. This is not normal, as is cpanel not normal.

Anyone know about this?

chmod root

Active Member
Oct 18, 2006
151 is redirecting to main.domain

I deleted all instances of the addon from /var/cpanel/users, named.conf, httpd.conf, etc. and re-added it fresh. I deleted .htaccess file and redid the MAIN domain redirect via cpanel as to

now the main redirects fine, but addon STILL redircects to main domain???


Well-Known Member
Jan 2, 2006
Yep, I think this is normal cpanel behaviour.

If you redirect the primary hosted domain on an account - all the addons also get redirected there.

I guess its just another bug they couldnt be bothered to fix.


May 28, 2006
Does anyone know of a manual way to fix this? I have been searching for weeks trying to figure this out and beating my head endlessly against the wall trying to get this to work properly.

Here is my example:

My shopping cart is currently at

I want it to be accessible when users go to

I have setup a permanent (and tried temporary) redirect (using CPanel) and it works fine. However, every other subdomain also gets redirected to

For example: should get its data from but instead it gets redirected to

I am not sure if this is a "Bug" or not but it sure seems like it. It would be nice if it was fixed but in the mean time I really just need to get this working properly and am capable of editing whatever needs to be manually edited if someone could just point me in the right direction.

I appreciate your help in advance,


Well-Known Member
Mar 5, 2002
Vancouver, Canada
Firstly, I feel I should state that the behaviour you are seeing is not a bug. By design, Apache will inherit any settings in .htaccess to sub-directories. Because add-on domains reside in sub-directories of public_html, any redirect settings you make for the account's main domain automatically applies to the add-on domains to.

IMHO, there is a couple of things Cpanel could do differently to make things easier/better:
* Instead of arsing RedirectMatch, use the the mod-rewrite functions instead. With mod_rewrite, one can set rules per domain and thus get the resolution required here. See my example below.
* It would be nice if Cpanel set up add-on domains somewhere in the user's directory outside of the public_html directory, e.g. in public_html_addondomain. That way the main domain and add on domains can be configured independently.

Anyway, back to the problem. IceProducts, the following code in your .htaccess should give the desired result:
RewriteEngine On
rewritecond %{http_host} mydomain\.com$
rewriteRule !store* [R=301,L]
The first line enables mod_rewrite (quite obvious). The second line says that the settings that follow only apply to hosts that end with, e.g. and, and hence excludes your add-on domains. The third line checks if the URL includes the word "store", and if it does not, redirects to It also sends a 301 response, meaning the document has moved permanently.

I hope this helps ;)