ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

.htaccess index.php removal not working after site move

November 16, 2011 3:48am

Subscribe [3]
  • #1 / Nov 16, 2011 3:48am

    Jonathan Morgan

    51 posts

    We’re in the process of moving a site from a Media Temple (gs) to a vps.net server. The site is now working on the new server, but for some reason the .htaccess file is no longer removing the index.php, which means that links are broken.

    mod_rewrite is installed on the server (see http://workisprogress.co.uk/info.php). 

    I’m using the File and Directory Check method, with the following code in the .htaccess file:

    RewriteEngine On 
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    Although I’ve also tried:

    RewriteEngine On 
    RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Any ideas what I’m doing wrong?

    Thanks!

  • #2 / Nov 16, 2011 10:13am

    Do any htaccess rules work, even a simple test? Can you confirm that AllowOverride is set to All in your httpd.conf file?

  • #3 / Nov 16, 2011 2:12pm

    Dan Decker

    7338 posts

    Hi Jonathan Morgan,

    I’ve got a couple of things for you to try in order for us to trouble shoot this. First of all, have you made sure that index.php has been removed from Admin-> General Configuration: Name of your site’s index page ? Have you run the Server Wizard on the new server to verify that it meets ExpressionEngine’s requirements? If you replace the last line in your example with this:

    RewriteRule ^(.*)$ /index.php?/$1 [L]

    What are the results?

    And lastly, can you post the entire contents of your .htaccess file, just incase there is something else at play here?

    Thanks!

  • #4 / Feb 20, 2012 12:51am

    illustrationdan

    26 posts

    Im having the same problem, moving to a vps.net server and my lghtaccess generator isnt working, although the 301 redirects in my .htaccess are working, any ideas?

  • #5 / Feb 20, 2012 1:20am

    illustrationdan

    26 posts

    I found a solution for this, seems its a php upgrade issue. In your htaccess

    Replace this:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php/$1 [L]

    With this:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /index.php?/$1 [L]

    the only difference is the ? after index.php and now my vps.net site works without index.php

  • #6 / Feb 23, 2012 5:44pm

    Dan Decker

    7338 posts

    Hi illustrationdan,

    Thanks for sharing your solution!

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases