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.

Invalid command error when adding Redirect in cPanel (SOLVED)

Discussion in 'General Discussion' started by sneader, Jan 7, 2013.

  1. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    A customer added a subdomain in cPanel, which they wanted to redirect to another website. When they use the Redirect feature in cPanel to add the redirect, they received an error, as follows:

    Subdomain Redirection

    foo.example.com is currently being redirected to: unchanged(Apache detected an error in the Rewrite config.
    Syntax error on line 1 of /home/example/public_html/.htaccess.SS4E3unJ7jwRQDXYxJE8UyGKYLlOL_aC:
    Invalid command 'suPHP_ConfigPath', perhaps misspelled or defined by a module not included in the server configuration
    Please try again.) .

    The first line of their .htaccess has:

    suPHP_ConfigPath /home/example/public_html/

    That line is there because the customer has their own custom php.ini, and this line tells Apache to use the php.ini in the public_html directory for all subdirectories, too (otherwise the customer would need to have separate php.ini files for every subdirectory that needs overrides).

    SOLUTION:

    I opened a ticket with cPanel, to see if this was a bug or if we were doing something wrong. Turns out we were doing it wrong. :) Here's the solution... need to wrap the suPHP_ConfigPath directive in an ifModule....

    I hope this helps someone else in the future.

    - Scott
     
  2. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    31
    Likes Received:
    1
    Trophy Points:
    8
  3. sneader

    sneader Well-Known Member

    Joined:
    Aug 21, 2003
    Messages:
    1,126
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    La Crosse, WI
    cPanel Access Level:
    Root Administrator
    Thanks for that link... clearly my Google-foo skills sucked on this one!!

    - Scott
     
Loading...

Share This Page