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.

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:
    14,461
    Likes Received:
    195
    Trophy Points:
    63
    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
     
  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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,762
    Likes Received:
    662
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page