Forum Moderators: phranque

Message Too Old, No Replies

Use .htaccess to force a redirect of Cpanel

Redirect Cpanel

         

petersinger

11:29 pm on Jan 19, 2008 (gmt 0)

10+ Year Member



Hi,

I would like to use .htaccess to force a redirect of [mydomain...] to something else.

A standard redirect does not work as cpanel is a system redirect and cannot be overriden in the normal way.

I tried to create a directory called cpanel and put an htaccess in that directory with no sucess.

How can a reddirect of cpanel be achieved to overide the system redirect?

Regards Peter

jdMorgan

12:34 am on Jan 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cpanel takes priority, since it is configured in the httpd.conf server config file. This cannot be overridden with .htaccess files, which execute later. You will have to modify httpd.conf, or ask your host to do so.

Also, if your host agrees to do this without any argument, consider getting a new host; The reason it's done this way is to prevent malicious attacks on the cPanel script (because it is "shared" by all users of the server).

Jim

petersinger

1:14 am on Jan 20, 2008 (gmt 0)

10+ Year Member



Can you not do something like?

if domain is "mydomain.com" then go to #*$!.otherdomain.com when mydomain.com/cpanel is called without comprimising security.

or if exist homedirectory/username/cpanel/.local when mydomain.com/cpanel is called goto the address in that file instead of the server default without compromising security?

Regards

Peter

Marcia

2:37 am on Jan 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cpanel takes priority, since it is configured in the httpd.conf server config file. This cannot be overridden with .htaccess files, which execute later. You will have to modify httpd.conf, or ask your host to do so.

Peter, what would make trying to redirect to a subdomain with .htaccess an exception to that?

petersinger

5:53 am on Jan 20, 2008 (gmt 0)

10+ Year Member



As a host I do not want my customers to see my providers address in cpanel and webmail

myprovider.com:2096/#*$!

If I use a masked domain I can hide it from the averave user.

But I cannot force a change of mydomain/cpanel to myhost marsked.

So any sugestions would help.

Marcia

8:33 am on Jan 20, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>As a host I do not want my customers to see my providers address in cpanel and webmail
>>myprovider.com:2096/#*$!

It's your provider's box and they have control over the configuration, you can't do a thing about it. If you're doing hosting for people with domains using Cpanel, then you should have the WHM control panel for your reseller account to set up your customers' accounts. And your customers should be able to access their control panel and mail using theirdomain.com:1234 or mail.example.com

Some providers of reseller hosting stay transparent and/or let you have your own branded Cpanel for an extra charge, and many provide your branded Cpanel included in your reseller hosting package at no extra charge - and an IP number, too.

If your provider doesn't allow it, and can't be transparent, then change providers. Cpanel reseller hosting is cheap enough, with plenty of choices out there.