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.

htaccess not working on my VPS with cpanel

Discussion in 'General Discussion' started by msceliot, Jun 25, 2011.

  1. msceliot

    msceliot Registered

    Joined:
    Jun 25, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have a website which was on a VPS with directadmin Control Panel, but I have just moved to another VPS with Cpanel. It used to work when it wan on the old VPS but in the new one I can’t make it work..!!

    I can open the main page (which is index.php) greatly but when I want to go to www.mydomain.com/news (this should be defined as www.mydomain.com/index.php/news by htacces ) it shows me the main page. I have installed CodeIgniter (the framework I am using for my script) in the public_html folder (which is under home/user).

    I have full admin access to my VPS, WHM/Cpanel and I can make any changes.

    this is the .htaccess that was working for me in my old VPS:
    Code:
    Options FollowSymLinks
    <IfModule mod_rewrite.c>
        RewriteEngine on
        
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php/$1 [L]
    </IfModule> 
    
    <IfModule !mod_rewrite.c>
        # If we don't have mod_rewrite installed, all 404's
        # can be sent to index.php, and everything works as normal.
        # Submitted by: ElliotHaughin
    
        ErrorDocument 404 /index.php
    </IfModule>  
     
  2. msceliot

    msceliot Registered

    Joined:
    Jun 25, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    I have just found that by converting this line:
    Code:
    RewriteRule ^(.*)$ index.php/$1 [L] 
    to this one:
    Code:
    RewriteRule ^(.*)$ index.php/$1 [R] 
    means changing flag [L] to [R], it works, but it just converts www.domain.com/news to www.domain.com/index.php/news and shows in the addressbar and this not what I want.

    Do you have any solution?! Should I change any configuration on Cpanel?!
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    There are no cPanel configuration changes that should be made. You may want to consider checking the documentation or support methods for the "CodeIgniter" application you are using. I did a quick search, and found the issue you have reported is listed on their website at:

    CodeIgniter URLs : CodeIgniter User Guide

    It looks like there is an additional "RewriteCond" line compared to what currently exists in your .htaccess file.

    Thank you.
     
Loading...

Share This Page