Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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,156
    Likes Received:
    40
    Trophy Points:
    178
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelKeithS

    cPanelKeithS Active Member
    Staff Member

    Joined:
    Oct 14, 2008
    Messages:
    32
    Likes Received:
    1
    Trophy Points:
    133
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. sneader

    sneader Well-Known Member

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

    - Scott
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice