Cpanel redirect method not working

Discussion in 'Bug Reports' started by felosi, Jun 23, 2011.

  1. felosi

    felosi Well-Known Member

    not sure how long its been like this or if cpanel changed, not sure if it ever worked. I thought it did. But recently tried to add some redirects from cpanel and simply didnt work in ,.htaccess, tried adding same rules to httpd.conf didnt work. here are the rules that didnt work.

    Running current version of lsws

    RewriteCond %{HTTP_HOST} ^hostingsplus\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.hostingsplus\.com$
    RewriteRule ^vps\-hosting$ "http\:\/\/hostingsplus\.com\/your\-choice\-of\-hosting\/vps\-hosting\/" [R=301,L]
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^shared\-hosting$ "http\:\/\/hostingsplus\.com\/your\-choice\-of\-hosting\/shared\-hosting\/" [R=301,L]
    RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^ddos\-protected\-hosting$ "http\:\/\/hostingsplus\.com\/your\-choice\-of\-hosting\/ddos\-protected\-hosting\/" [R=301,L]
    I had to change it to these rules manually to get it to work:

    Redirect /shared-hosting
    Redirect /ddos-protected-hosting
    Redirect /vps-hosting
    Redirect /reseller-hosting-plans

    I have had to do this for a few clients so far.
  2. webizen

    webizen Well-Known Member

    Based on the redirects, try the following rewrite rules in .htaccess
    #RewriteCond %{HTTP_HOST} ^hostingsplus\.com$ [OR]
    #RewriteCond %{HTTP_HOST} ^www\.hostingsplus\.com$
    RewriteRule ^vps-hosting$ "" [R=301,L]
    #RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^shared-hosting$ "" [R=301,L]
    #RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^ddos-protected-hosting$ "" [R=301,L]
    #RewriteCond %{HTTP_HOST} ^.*$
    RewriteRule ^reseller-hosting-plans$ "" [R=301,L]
    Also add following lines to the vhost section in httpd.conf to enable rewritelog for debugging (error_log).

  3. felosi

    felosi Well-Known Member

    I know what has to be done to MANUALLY edit the .htaccess. But what I reported is simple - When you add a site redirect inside CPANEL the rewrite rules it puts in the .htaccess do not work with litespeed which means litespeed is not fully compatible with cpanel.

    I or other hosts cannot simply wait until a client trys to add a redirect, see it not work, put in ticket and manually edit their .htaccess.

    take it how you will, I dont need to know what to put where. It does not work default with cpanel on a fresh server so therefore I think is a legit bug request.

    Also I have already tried what you suggested, commenting out the rewritecond, same thing.
  4. webizen

    webizen Well-Known Member

    Should have mentioned that the rules you posted in the first place (NOT manually edit) are also fine in our lab testing with the latest LSWS. It must be something else.

    Did you enable Rewrite Logging and see why those rules are not working for you?

    BTW, what's the LSWS version in question?
    Last edited: Jun 24, 2011

Share This Page