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.

.htaccess file does't work for the new cPanel hosting.

Discussion in 'General Discussion' started by dragonbro, Apr 1, 2014.

  1. dragonbro

    dragonbro Member

    Joined:
    Apr 1, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I just moved my website from a old classic Godaddy Linux hosting to a new cPanel one. There's a problem: The .htacess file does't work for the cPanel hosting (it works well for the classic hosting).

    I use the .htaccess file to redirect people with Chinese browsers to another URL (google.com). the codes are as follow:

    Code:
    #BEGIN Block Chinese Browser
    Options +FollowSymLinks
    RewriteEngine on 
    RewriteCond %{HTTP:Accept-Language} ^zh-cn.*$ [NC,OR]
    RewriteCond %{HTTP:Accept-Language} ^zh.*$ [NC]
    RewriteRule ^.*$ http://www.google.com [R=302,L]
    #END Block Chinese Browser
    How can I make it work for the cPanel hosting?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Do you notice any error messages in the "Error Log" option within cPanel? Have you contacted your hosting provider to get their input on the matter?

    Thank you.
     
  3. es2alna

    es2alna Well-Known Member

    Joined:
    Mar 30, 2014
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Egypt
    cPanel Access Level:
    Root Administrator
    I guess this is something related to security, try commenting out this line:
    Code:
    #Options +FollowSymLinks
    if it worked then its related to the security of Apache.
     
  4. dragonbro

    dragonbro Member

    Joined:
    Apr 1, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I deleted this line, but it still doesn't work.

    - - - Updated - - -

    The hosting provider (Godaddy) said they are not going to support such things. Below are what they said:

    Support Staff Response
    Dear Sir or Madam,
    Thank you for contacting online support.

    We do not do custom scripting, I would recommend checking on w3schools.org to see if your coding is correct.

    If you have any further questions regarding this issue please let us know.
    Sincerely,
    Joe G.
    Professional Hosting Services
     
  5. dragonbro

    dragonbro Member

    Joined:
    Apr 1, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Checked the "Error Log", no anything on it.
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,723
    Likes Received:
    660
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    You may want to consult with someone that specializes in Mod_Rewrite rules to determine what changes you can make to achieve the redirect.

    Thank you.
     
  7. FEERspreads

    FEERspreads Registered

    Joined:
    Apr 15, 2014
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Can you explain how it doesn't work? I'm having a similar problem that I think I've pinpointed to the mess of overly thought-out httpd.conf files (although I'm still trying to get help with my issue). My .htaccess redirect code causes my pages to have no output, just a white window. Is this the same for you?
     
  8. dragonbro

    dragonbro Member

    Joined:
    Apr 1, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    My case is the the webpage is not redirected at all (still the original webpage), as if the .htaccess does not exist.
     
Loading...

Share This Page