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!

mod_rewrite - editing httpd.conf or adding to htaccess

Discussion in 'General Discussion' started by Richard Ainz, Jun 9, 2016.

Tags:
  1. Richard Ainz

    Richard Ainz Member

    Joined:
    Feb 15, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    When adding the lines

    RewriteEngine On
    Options FollowSymLinks

    to a .htaccess placed in the root of a web script claiming to use it for permalinks, the interface tells me it does not find the mod_rewrite engine activated.

    When trying to get to the httpd.conf to enable it that way, I do not seem to have access to that file on the webhost.

    So the question would be; should mod_rewrite be enabled with those lines in .htaccess or do I need to contact the host to get this done deeper in the apache configuration I do not seem to be able to reach? (Which is strange since it is on a VPS).
    System: Apache 2.4.18 with PHP 5.6.19 on CENTOS 6.4 x86_64
     
  2. Richard Ainz

    Richard Ainz Member

    Joined:
    Feb 15, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    So no one ever wondered how to do this...
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,585
    Likes Received:
    439
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    mod_rewrite should be enabled by default in cPanel. Do you have root access to the server? If yes, run this command via SSH:
    httpd -l|grep rewrite
    The response should be:
    mod_rewrite.c
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Richard Ainz

    Richard Ainz Member

    Joined:
    Feb 15, 2015
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thanks, I did that, it is enabled. Then I know I:

    - either need to define something for it to work
    - the web script thing is flawed
     
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,475
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    It seems like this is a flaw in the application you are using. You can try creating some simple Mod_Rewrite rules for a test page to verify it's working as expected in that directory.

    Thank you.
     
    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