Welcome Guest, Not a member yet? Register   Sign In
Anyone familiar with IIS Rewrite?
#1

[eluser]dallen33[/eluser]
I want URLs like this:

http://website.com/application1
http://website.com/application2

To re-direct to the proper application folder. My folder structure for CI2 is as follows:

index.php
- ci_apps
-- application1
-- application2
- ci_system

I'm guessing I need to use URL rewrite to do this, but I have no idea how to accomplish this. Right now, my web.config file looks like this:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
    
        <defaultDocument>
            <files>
                <clear />
                <add value="index.php" />
                <add value="index.htm" />
                <add value="index.html" />
                <add value="Default.htm" />
                <add value="Default.asp" />
                <add value="iisstart.htm" />
            </files>
        </defaultDocument>

        <rewrite>
            <rules>
                <rule name="ci_rule_01" stopProcessing="true">
                    <match url="(index.php|robots.txt|sitemap.xml|info.php|favicon.ico|testing|ci_apps)" />
                </rule>
                <rule name="ci_rule_02">
                    <match url=".*" />
                    <action type="Rewrite" url="index.php/{r:0}" appendQueryString="false" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Someone in another thread suggested I use this:

Code:
RewriteEngine on

RewriteCond $1 !^(index\.php)
RewriteRule ^([^/]+)/(.*)?$ - [E=PATH_APPLICATION:$1,NE]

RewriteCond $1 !^(index\.php)
RewriteRule ^([^/]+)/(.*)?$ index.php?/$2 [L]

But, in all honesty, I know nothing about modRewrite that would allow me to decipher that and get it working with IIS URL Rewrite.

Any ideas how I can do this?


Messages In This Thread
Anyone familiar with IIS Rewrite? - by El Forum - 08-09-2010, 04:41 PM
Anyone familiar with IIS Rewrite? - by El Forum - 08-09-2010, 08:35 PM
Anyone familiar with IIS Rewrite? - by El Forum - 08-09-2010, 08:57 PM
Anyone familiar with IIS Rewrite? - by El Forum - 08-09-2010, 09:22 PM
Anyone familiar with IIS Rewrite? - by El Forum - 08-09-2010, 09:29 PM
Anyone familiar with IIS Rewrite? - by El Forum - 08-10-2010, 01:49 AM



Theme © iAndrew 2016 - Forum software by © MyBB