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.

index.php not being removed

April 30, 2012 7:08am

Subscribe [3]
  • #1 / Apr 30, 2012 7:08am

    jackiewales

    37 posts

    I have moved my dev site to engine hosting and wish to remove index.php.  My htacess contents read as below. The problem is that index.php is not being removedfrom the url.

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

     

     

  • #2 / Apr 30, 2012 7:18am

    Steve Fairhurst

    168 posts

    Go in to admin > general config > Name of your site’s index page and remove index.php

  • #3 / Apr 30, 2012 7:23am

    jackiewales

    37 posts

    Thank you I have already done that

  • #4 / Apr 30, 2012 5:01pm

    Dan Decker

    7338 posts

    Hello Jack,

    You should edit the RewriteRule to take *out* the “?”

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

    If you make that change, does it behave properly?

    Also, make sure you check off all the items outlined in Moving ExpressionEngine to Another Server.

    Cheers,

  • #5 / May 01, 2012 2:00pm

    jackiewales

    37 posts

    Thank you, this worked for me on engine hosting:

    <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>
  • #6 / May 01, 2012 2:03pm

    btko

    9 posts

    I’m not sure if I should make a new topic. but I can’t get this to work either.
    I’m on localhost though.

    I’ve followed all of the steps in the guide and when I get a “Not Found” when I go to the URL without the index.php

  • #7 / May 02, 2012 2:55pm

    Dan Decker

    7338 posts

    Hi btko,

    What server environment are you running on your localhost?

    If you have apache, you need to make sure that overrides are allowed, or .htaccess directives won’t have an effect.

    Feel free to share your .htaccess directives here and we can give them a look over as well.

    Cheers,

  • #8 / May 02, 2012 10:33pm

    btko

    9 posts

    Hi thanks for the reply,

    I have apache, mysql, php server running on localhost.
    I’ve been trying to follow tutorials on allowing overides, but they don’t seem to work.
    Well… I’m likely not following them correctly.

    Here is my .htaccess file:

    <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>
  • #9 / May 03, 2012 3:12pm

    Dan Decker

    7338 posts

    Hi btko,

    That’s the proper .htaccess, so it must boil down to whether apache is configured to allow overrides.

    What OS are you using? Are you running the services separately, or in a package like MAMP?

    I might still be able to help get this sorted out.

    Cheers,

  • #10 / May 03, 2012 10:44pm

    btko

    9 posts

    Thanks for the reply, and sorry it seems like I have a couple threads going on this same issue :o

    I’m running the services separately and I’ve been trying to gonfigure the overrides but I’m at a stand still
    at the moment.

  • #11 / May 07, 2012 3:31pm

    Dan Decker

    7338 posts

    Hi btko,

    Indeed, having the threads split can be a bit confusing 😉

    I provided some info in the other thread that may have proven useful.

    For clarity and sanity, I’m going to resolve this one and we will focus in on the other one.

    If anyone else here has other issues that need attention, please feel free to start another thread!

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases