removing index.php from ExpressionEngine [Answered]RSS

6 replies

Last post Sep 25, 2012 10:26 AM by bmallett

  • removing index.php from ExpressionEngine

    Apr 14, 2009 01:27 PM|krypton|LINK

    Morning,

    I have installed the ExpressionEngine on my webserver, and configured.  Runs smooth, but I am trying to remove index.php from the address bar.

    The documentation says to add the following into the .htaccess file:

    RewriteEngine on
    RewriteCond $1 !^(css|js|swf|images|system|tools|themes|index\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Of course II7 does not support .htaccess, but I am wondering if anyone else has been able to successfully remove index.php from their URL bar?

  • Re: removing index.php from ExpressionEngine

    Apr 14, 2009 08:24 PM|ksingla|LINK

    Try IIS7 URLRewrite module. You can install it from www.iis.net/extensions. IIS7 UrlRewrite module UI can import rule from htaccess files. So configuring it will be pretty easy.

    Thanks.
    Kanwal

  • Re: removing index.php from ExpressionEngine

    Apr 15, 2009 04:31 PM|krypton|LINK

    that worked like a charm, thanks!!!

  • Re: removing index.php from ExpressionEngine

    Apr 22, 2009 07:29 PM|krypton|LINK

    Hi,

    I might have been a tad too quick on my repsonse, this worked, but now it does not.  Here is my web.config file once I imported from the htaccess file into the URL Rewrite

     <?xml version="1.0" encoding="UTF-8"?>
    <configuration
    >
        <
    system.webServer
    >
            <
    defaultDocument
    >
                <
    files
    >
                    <
    remove value="default.aspx"
    />
                    <
    remove value="iisstart.htm"
    />
                    <
    remove value="index.html"
    />
                    <
    remove value="index.htm"
    />
                    <
    remove value="Default.asp"
    />
                    <
    remove value="Default.htm"
    />
                    <
    add value="index.php"
    />
                </
    files
    >
            </
    defaultDocument
    >
            <
    rewrite
    >
                <
    rules
    >
                    <
    rule name="Imported Rule 1" stopProcessing="true"
    >
                        <
    match url="^(.*)$" ignoreCase="false"
    />
                        <
    conditions logicalGrouping="MatchAll"
    >
                            <
    add input="{R:1}" negate="true" pattern="^(pdfs|css|js|swf|images|f-system|tools|themes|index\.php)"
    />
                        </
    conditions
    >
                        <
    action type="Rewrite" url="/index.php/{R:1}"
    />
                    </
    rule
    >
                </
    rules
    >
            </
    rewrite
    >
        </
    system.webServer
    >
    </
    configuration>

    all the interiour pages are working fine, but when I go to www.mydomain.com, I get a dead page, until I type www.mydomain.com/index.php.

    Ideas or suggestions?

  • Re: removing index.php from ExpressionEngine

    Apr 23, 2009 11:32 AM|brashquido|LINK

    I'm only using the EEcore in my testing environment, however your rules work perfectly for me using URL rewrite 1.1. By dead page I assume you mean a 404? What are your IIS logs reporting?

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    IIS Aid
    IIS and Open Source
  • Re: removing index.php from ExpressionEngine

    Apr 23, 2009 06:29 PM|krypton|LINK

    Hi,

    I dont see the 404 page I created, I simply get:

     

    <div id=header>

    Server Error

    </div> <div id=content> <div class=content-container>

    403 - Forbidden: Access is denied.

    You do not have permission to view this directory or page using the credentials that you supplied.

    </div></div>
  • Re: removing index.php from ExpressionEngine

    Sep 25, 2012 10:26 AM|bmallett|LINK

    I know this is an older thread (2009), but I hate seeing anything in "support" forums be left for dead.

    I am assuming that you are having troubles seeing your system folder to access your settings, etc..

    Everything you had seems to work for me in browsing my site with those settings. The only issue I had was accessing my system folder. That can be fixed by adding it to the exception line in your rule above.

    So in the following line you had:

    [code][/code]

    If you would add:

    [code][/code]

    ... changing 'system', to whatever you have renamed your system folder to and removing the 'f-system', you should be fine. The other thing you may need to do is remove index.php from your config settings in your control panel.

    In fact, after testing further, you can even leave the index.php in the CP settings.