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.

Rewrite Engine not working

Discussion in 'Security' started by anto91, Nov 18, 2008.

  1. anto91

    anto91 Registered

    Joined:
    Nov 18, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I'm totally new to cPanel so your going to have to forgive me if this is a rookie mistake !

    I have the following code in my .htaccess on one of my domains
    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !\.(js|ico|gif|jpg|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /$1.php
    
    And i manually edited the httpd.conf in /usr/local/apache/conf/httpd.conf
    Changed the line AllowOverride None to AllowOverride All

    But when i try and access www.domain.com/somepage i get a 404
     
    #1 anto91, Nov 18, 2008
    Last edited: Nov 18, 2008
  2. lngtanseco

    lngtanseco Well-Known Member

    Joined:
    Jun 9, 2006
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    6
    Check the logs at:

    Code:
    vi /usr/local/apache/domlogs/domain.com
    change domain.com with your true domain name.

    Also, apache error logs should be able to help you pinpoint the problem.

    Code:
    vi /usr/local/apache/logs/error_log
     
  3. anto91

    anto91 Registered

    Joined:
    Nov 18, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    All it says is
    Code:
    xxx.xxx.xxx.xxx - - [18/Nov/2008:20:45:31 +0100] "GET /~eks/login HTTP/1.1" 404 2117
    

    Just noticed something when i try and access www.apaydo.com/~eks/info i get the following 404

    Code:
    Not Found
    
    The requested URL /info.php was not found on this server.
    
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Apache/2.0.63 (Unix) mod_ssl/2.0.63 OpenSSL/0.9.8b mod_bwlimited/1.4 PHP/5.2.5 Server at apaydo.com Port 80
    
    Notice its trying to access info.php so it seams like the rewrite is working

    The next weird bit is the following
    Output of ls /home/eks/public_html
    Code:
    root@ns1 [/home/eks/public_html]# ls
    ./        calender.php  event.php   .htaccess.bak  info.php   logout.php  register.php  _vti_bin/      _vti_log/
    ../       cgi-bin/      home.php    images/        library/   news.php    search.php    _vti_cnf/      _vti_pvt/
    contact.php   .htaccess*  index.php      login.php  _private/   test.php      _vti_inf.html  _vti_txt/
    
     
    #3 anto91, Nov 18, 2008
    Last edited: Nov 18, 2008
  4. anto91

    anto91 Registered

    Joined:
    Nov 18, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
  5. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Hmm, I have never experienced the issue described in that blog. If it is your server (you are the hosting provider/system administrator), please submit a support ticket. Otherwise, have your hosting provider contact us directly so we can resolve this issue.
     
  6. anto91

    anto91 Registered

    Joined:
    Nov 18, 2008
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    It's a dedicated server that our company owns but is hosted by another company.

    I sent a request to ticket anyway, but i would really like to know the solution myself so the problem does not repeat itself
     
Loading...

Share This Page