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_write problem

Discussion in 'General Discussion' started by Serra, Jun 19, 2012.

  1. Serra

    Serra Well-Known Member

    Joined:
    Oct 27, 2005
    Messages:
    213
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Florida
    I've just setup a new server and I'm having an issue with an account using mod_rewrite. The solution must be simple, but I'm at a loss to what it is.

    .htaccess:
    Code:
    [B]Options +FollowSymLinks
    RewriteEngine on
    RewriteRule testpage.html http://www.google.com [R][/B]
    
    This results in a 404 page and a log entry:
    [Tue Jun 19 06:00:55 2012] [error] [client xxx.xxx.xxx.xxx] File does not exist: /home/xxxxxxx/public_html/testpage.html

    I tested this on another server to verify there were no typos and it works fine.

    I know mod_rewrite is installed, I've verified that.
    I know it works on another account, I've tested that.

    I just can't get it to do anything on this account. Any ideas?
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Have you tried adding the Redirect from the Redirects section of your cPanel?
     
  3. Serra

    Serra Well-Known Member

    Joined:
    Oct 27, 2005
    Messages:
    213
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Florida
    The redirect is a test to make sure that mod_rewrite is working. It isn't the final .htaccess file. I used something simple so that an issue with the file could be ruled out.

    The fact that it isn't working, is the issue, not trying to achieve the very simple redirect.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Try creating one via Redirects and then compare it to yours.
     
  5. Serra

    Serra Well-Known Member

    Joined:
    Oct 27, 2005
    Messages:
    213
    Likes Received:
    4
    Trophy Points:
    18
    Location:
    Florida
    ...and that solved the problem.

    Code:
    RewriteRule ^testfile\.html$ "http\:\/\/google\.com\/"
    Thank you.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,476
    Likes Received:
    202
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Great news then! You're welcome. :)
     
Loading...

Share This Page