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.

301 redirect with wildcard not working

Discussion in 'General Discussion' started by antonsvideo, Dec 5, 2011.

  1. antonsvideo

    antonsvideo Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I want to create a permanent redirect so that all pages without www are redirected to www

    it used to work but now with latest cpanel, an error is produced

    I had to create a htaccess file manually in notepad, to make it work, it needs to look like this, but this can't be done in cpanel

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^totalinteriors.com.au$
    RewriteRule ^/?(.*)$ "http\:\/\/www\.totalinteriors\.com\.au\/$1" [R=301,L]
     

    Attached Files:

  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We have an internal case (45621) about this issue already opened. Can you post your current cPanel version?

    Code:
    cat /usr/local/cpanel/version
    Also, please try removing the trailing slash (/) on the "redirects to" field for http://www.totalinteriors.com.au/ entry so that it shows as the following:

    redirects to -> http://www.totalinteriors.com.au

    The trailing slash is what is causing the issue and what is reported in the internal case.
     
  3. antonsvideo

    antonsvideo Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am using cPanel Version 11.28.87

    removing the trailing slash is not an option

    if I remove it, then all pages other than the home page fail to redirect, in other words, the widcard becomes useless
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    cPanel version 11.28.87 is an outdated build of cPanel at this time. Are you able to update cPanel to the latest version available on your build tree? This can often resolve bugs, as we do not always backport all bug fixes to previous versions.

    Thank you.
     
  5. antonsvideo

    antonsvideo Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    will try that andd report back, thanks
     
    #5 antonsvideo, Dec 8, 2011
    Last edited: Dec 8, 2011
  6. antonsvideo

    antonsvideo Registered

    Joined:
    Apr 28, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I am now on cpanel 11.30.5 (build 2) and the issue is mostly resolved, thanks

    as you mentioned, it fails with trailing slash
     
Loading...

Share This Page