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.

Removing index.php not working... stumped!

March 12, 2012 9:35pm

Subscribe [2]
  • #1 / Mar 12, 2012 9:35pm

    Coalescent

    48 posts

    Hi -

    We’re just setting up a new EE 2.4 site for a client who wants to use a hosting provider we have no experience with (and they’re actually not really a hosting company - it’s a bit dubious). Anyway, for some reason, removing index.php is not working for us using the same method we use on other hosts.

    We are using the exclude method as follows in our htaccess:

    RewriteEngine on 
    
    # Exclude codeigniter requests
    RewriteCond $1 !^(codeigniter|images|system|themes|_img|_css|_js|_docs|_cache|galleria|favicon\.ico|robots\.txt|index\.php|admin\.php|codeigniter\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    But while a couple quick test entries are coming up fine (http://65.39.243.86/index.php/Templates/Test/first-page) with the index.php in the URL, if we omit it (http://65.39.243.86/Templates/Test/first-page) we end up on the homepage.

    We have also removed index.php from the General Configuration.

    Can anyone suggest what the issue might be? I’m stumped and wondering whether there could be something else configured on the new host we’re unaware of? We did try a couple other simple 301 redirects in the htaccess and those worked.

    Thanks,
    Mike

  • #2 / Mar 13, 2012 1:33pm

    Shane Eckert

    7174 posts

    Hello Coalescent,

    I am sorry to hear you are running into this problem.

    Can you save your .htaccess file to the side and try this one?

    <IfModule mod_rewrite.c>
            RewriteEngine On
    
            # Removes index.php
            RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
            RewriteCond %{REQUEST_FILENAME} !-f
            RewriteCond %{REQUEST_FILENAME} !-d
            RewriteRule ^(.*)$ /index.php/$1 [L]
    
            # If 404s, "No Input File" or every URL returns the same thing
            # make it /index.php?/$1 above (add the question mark)
    </IfModule>

    As well, can you make sure mod_rewrite is enabled on this server?

    Hopefully one or both of these steps will help pinpoint the issues.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases