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.

Cannot get RewriteRule to work, at all!

Discussion in 'General Discussion' started by Cipherlad, Sep 12, 2011.

  1. Cipherlad

    Cipherlad Registered

    Joined:
    Sep 12, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    Specifying anything for RewriteRule does nothing. I understand mod_rewrite is supposed to be installed automatically (I'm using the latest version of cPanel). But nothing works. Creating a redirect 301 line in my .htaccess file is good, so I know it's processing the file, but if I put in the following:

    RewriteRule ^/articles/([^/]+)/([^/]+)\.htm$ http://www.mydomain.com/articles/$1/ [NC,R=301,L]

    ...it seems as though it's ignored. Even the following is ignored:

    RewriteRule ^/articles/gooseliver/page1\.htm$ http://www.mydomain.com/articles/gooseliver/ [NC,R=301,L]

    No matter what I try, I get the "Page Not Found" error. (but, redirect 301 /articles/gooseliver/page1.htm http://www.mydomain.com/articles/gooseliver/ works).

    Another post had mentioned checking the error log, but I don't know where that is.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The error log would be at /usr/local/apache/logs/error_log for someone with root SSH access. If you only have account level access, you can try checking cPanel > Error Log area.
     
  3. Cipherlad

    Cipherlad Registered

    Joined:
    Sep 12, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I'll be checking that this evening. In the meantime, do the RewriteRule examples look right? Am I doing anything wrong in the syntax? Is there anything about the placement in, or other statements I need to put in the .htaccess file, that I need to be aware of?
     
  4. Cipherlad

    Cipherlad Registered

    Joined:
    Sep 12, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Rewrite rules not working are going to be based on the specific rewrite rules, so the issues aren't exactly the same other than that some rewrite rules aren't working. We do not know what rewrite rules were being used in that thread as they were not noted.

    As for issuing commands, that individual has root access to run commands. Such commands cannot be run in cPanel and mod_rewrite is always available with cPanel, so that itself is not the issue.

    Contacting your hosting provider would be the best way to have this investigated.
     
  6. thiagoprado

    thiagoprado Registered

    Joined:
    Sep 1, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Same problem with me!
     
  7. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Have you contacted your host if you do not have root access? Have you checked the error logs? What have you done for troubleshooting purposes besides posting here? Thanks!
     
Loading...

Share This Page