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 method not working properly?

February 28, 2011 5:07am

Subscribe [3]
  • #1 / Feb 28, 2011 5:07am

    Loquela

    105 posts

    Hi there,

    I am using the following method to “remove” index.php from my url:

    RewriteEngine on 
    RewriteCond $1 !^(images|system|themes|favicon\.ico|robots\.txt|index\.php) 
    RewriteRule ^(.*)$ /index.php/$1

    This does allow me to access pages when I don’t include index.php in the address bar, but it doesn’t actually remove index.php. For example, I am using {path} in many of my links and this includes index.php. When clicking on these links, index.php is still visible in the URL?

    Thanks in advance,

    L.

  • #2 / Feb 28, 2011 8:04am

    jcowen

    66 posts

    I think you need to go to Admin > System Preferences > General Configuration and in the field: ‘Name of your site’s index page’ it probably still says index.php.

    Delete this and that should work?

  • #3 / Feb 28, 2011 8:12am

    Loquela

    105 posts

    Thanks mekonta,

    You mean Admin > System Administration > Config File Editor?

    Yes, done that. Removed index.php from $config[‘index_page’]

    No, that doesn’t work. Still getting http://95.131.70.227/index.php/what-we-do

    Help… :-(

  • #4 / Feb 28, 2011 8:17am

    jcowen

    66 posts

    Oh, sorry. I still haven’t braved EE2 yet so yeah, maybe path is different.

    Is index.php being included when yo don’t use {path}? Might not be an exact answer to your problem but I’m wondering if you can leave it out and use relative paths?

  • #5 / Feb 28, 2011 8:47am

    Loquela

    105 posts

    Thanks mekonta,

    I’m sure that would work as I can just type in the url minus the index.php and it works fine. I could also just use {site_url} I suppose. But what about {title_permalink}? this still includes the index.php.

    Aghhh!

    L

  • #6 / Feb 28, 2011 9:43am

    John Fuller

    779 posts

    Admin -> General Configuration -> Name of your site’s index page -> Remove index.php get’s rid of the index.php in the links.  If that doesn’t work then perhaps you are caching something?

  • #7 / Feb 28, 2011 10:53am

    Loquela

    105 posts

    Hi there,

    Thanks John.

    I’ve removed the index.php from the config settings and flushed the cache both in EE2 and the browser. That pesky index.php is still there!

    L.

  • #8 / Feb 28, 2011 11:06am

    John Fuller

    779 posts

    Admin -> General Configuration -> Name of your site’s index page ->

    Go there are double check that there is nothing in there if you haven’t already.  😉 

    I know you did the config file, but check both locations as this obviously isn’t working as expected.

    Otherwise, I would create a new template somewhere and put in just a path = tag and see if it’s still appearing that way there.

  • #9 / Feb 28, 2011 11:29am

    Loquela

    105 posts

    Thanks for your continued help.

    You mean Admin -> System Administration -> Config File Editor, right?

    Yes, I have done that. And I set up separate template to test and yes, the {path} variable is including the index.php!

    Anything else I can try?

    L.

  • #10 / Feb 28, 2011 11:49am

    John Fuller

    779 posts

    Strange.  Why not post this in the official support forum to get help from Ellislab?  This isn’t an Apache rewrite problem at this point, you are trying to keep the index.php from showing.  They have more support options than we do.

  • #11 / Feb 28, 2011 11:51am

    Loquela

    105 posts

    Thanks John,

    You read my mind. Just done that!

    I’ll let you know what happens.

    Thanks both so far.

    L.

  • #12 / Mar 01, 2011 5:34am

    Loquela

    105 posts

    Both,

    Really, really sorry. I was blinded by all the trees! Couldn’t see for looking. Came in this morning and doh! there it was!

    In EE2 we have Admin -> General Configuration -> Name of your site’s index page, AND Admin -> System Administration -> Config File Editor

    I was only seeing the latter. I know you tried your best to explain to me, but I wasn’t listening!!  :red:

    All sorted.

    Thanks for your help and patience.

    L.

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

ExpressionEngine News!

#eecms, #events, #releases