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.

How can I remove /index.php in the address bar?

August 21, 2007 3:59am

Subscribe [0]
  • #1 / Aug 21, 2007 3:59am

    alpine

    22 posts

    hi,

    i know this topic has been discussed several times, but still…

    according to google and this website, you should be able to easily remove index.php and the following template name via .htaccess.
    however, this does not seem to work for me.

    now, i think that is because of me having a rewrite rule already.
    sadly, i do not understand these rules good enough to merge them.

    could somebody please help me with that?

    my current .htaccess looks as follows:

    RewriteEngine on
    RewriteBase /
    
    RewriteCond %{HTTP_HOST} ^www\.foo\.com$
    RewriteRule (.*) <a href="http://foo.com/$1">http://foo.com/$1</a> [R=Permanent]
    
    AddHandler php4-script .php

    and this is the solution i found for removing the index.php ( via ):

    RewriteEngine on
    RewriteCond $1 !^global/.*
    RewriteCond $1 !^images/.*
    RewriteCond $1 !^archive/.*
    RewriteCond $1 !^expressionengine/.*
    RewriteCond $1 !^index\.php.*
    RewriteRule ^(.*) index.php/$1 [NC,L]

    thanks in advance…

  • #2 / Aug 21, 2007 10:17am

    Chris Williams

    102 posts

    This is what mine has

    RewriteEngine on 
    RewriteCond $1 ^(site|story|member|search|forums|P[0-9]{2,8}) [NC] 
    RewriteRule ^(.*)$ /index.php/$1 [L]

    I pulled this page to do it.
    http://expressionengine.com/wiki/Remove_index.php_From_URLs/

  • #3 / Aug 21, 2007 10:31am

    alpine

    22 posts

    looks like it’s working 😊

    it does just work when i type it in the address bar manually, though.
    apparently ee is doing the index.php internally.

    any switch i have to turn-over in the control panel?

  • #4 / Aug 21, 2007 10:37am

    Chris Williams

    102 posts

    No idea.  It might be your server or the path.php if it was modified.  You’ve just reached the limit of what I know.

    Check your admin settings I guess. 😊

  • #5 / Aug 21, 2007 10:39am

    alpine

    22 posts

    alright 😉

    thanks for your help, though

  • #6 / Aug 25, 2007 10:09am

    alpine

    22 posts

    apparently ee is doing the index.php internally.

    any switch i have to turn-over in the control panel?

    i forgot to go to admin -> system preferences -> general configuration and leave the ‘URL to the root directory of your site’ field blank…

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

ExpressionEngine News!

#eecms, #events, #releases