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 leads to 500 error

Discussion in 'General Discussion' started by mojamoi, Feb 3, 2014.

  1. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    .htaccess starts like this:

    RewriteEngine On
    RewriteRule



    log files read liek this:
    [Sun Feb 02 20:30:20 2014] [alert] [client someIP] /home/somename/public_html/somename/.htaccess: Invalid command '\fgfgf\xghb\xgfRewriteEngine', perhaps misspelled or defined by a module not included in the server configuration
     
  2. cPanelPeter

    cPanelPeter Technical Analyst III
    Staff Member

    Joined:
    Sep 23, 2013
    Messages:
    569
    Likes Received:
    15
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Can you cat that .htaccess file here?

    Code:
    # cat /home/homename/public_html/somename/.htaccess
    
     
  3. mojamoi

    mojamoi Well-Known Member

    Joined:
    Jul 23, 2007
    Messages:
    186
    Likes Received:
    0
    Trophy Points:
    16
    Here is the code of .htaccess

    Thanks

     
  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 :)

    Check to make sure the file is formatted correctly. It's possible that it was edited on another environment (e.g Windows) and uploaded with invalid characters. Typically, you can run the following command to resolve this:

    Code:
    dos2unix /path/to/file
    If that does not help, try creating a new .htaccess file and adding those entries back in through a Linux text editor such as "vi".

    Note: You may have to install the "dos2unix" package via YUM.

    Thank you.
     
Loading...

Share This Page