The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel Redirects

Discussion in 'General Discussion' started by cgimickalo, May 29, 2013.

  1. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    Hello

    we have a customer who is attempting to setup and redirect through their cPanel. what they are trying to do is setup a rewrite rule so when this webpage is called up /signup/signup1.html they are redirected to the /signup/signup.html below is the rules setup in their htaccess file

    Code:
    RewriteOptions inherit
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.com
    RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    RewriteCond %{HTTPS} on
    
    RewriteCond %{HTTP_HOST} ^domain\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.domain\.com$
    RewriteRule ^signup\/signup1\.html$ "http\:\/\/www\.domain\.com\/signup\/signup\.html" [R=301,L]
    
    This was all setup within their cPanel control panel and it doesn't seem to be working or redirecting. Any help or suggestion would be appreciated.

    Thanks,
    Mike
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,830
    Likes Received:
    672
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    I added a similar redirect on a test server, and the following Mod_Rewrite rules worked successfully:

    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^cptest123\.info$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.cptest123\.info$
    RewriteRule ^signup\/123\.html$ "http\:\/\/cptest123\.info\/signup\/1234\.html" [R=301,L]
    It looks like your first rewrite rule may be conflicting with the second one. Have you checked to see if the issue persists after temporarily disabling the first custom rule, or by moving that first rule below the second one?

    Thank you.
     
  3. cgimickalo

    cgimickalo Well-Known Member

    Joined:
    Apr 19, 2013
    Messages:
    78
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    N.W. Iowa
    cPanel Access Level:
    Root Administrator
    After a few "Trial & Errors" reversing the rules around that seem to do the trick, not sure why, but it works now.

    Thanks,

    Mike
     
Loading...

Share This Page