Page 1 of 1

SEO friendly urls in IIS

Posted: Mon Nov 21, 2011 12:24 pm
by keoal77
Is this possible?

I have read other posts aaround the forum but can't find a clear answer, some saying it is not possible some saying it is using ISAPI.

There is also the suggestion in the wiki to put a "web.config" file in the root with the following code:

http://wiki.cmsmadesimple.org/index.php ... ty_URL.27s

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<configuration>

<rewrite>
                <rules>
                    <rule name="block favicon" stopProcessing="true">
                        <match url="favicon\.ico" />
                        <action type="CustomResponse" statusCode="404" subStatusCode="1" 
                            statusReason="The requested file favicon.ico was not found" 
                            statusDescription="The requested file favicon.ico was not found" />
                    </rule>
                    <rule name="Imported Rule 2" stopProcessing="true">
                        <match url="^(.*)$" ignoreCase="false" />
                        <conditions>
                            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="true" negate="true" />
                            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="true" negate="true" />
                <add input="{URL}" pattern="^/favicon.ico$" ignoreCase="false" negate="true" />
                        </conditions>
                        <action type="Rewrite" url="index.php?page={R:1}" appendQueryString="true" />
                    </rule>
                </rules>
            </rewrite>

</configuration>
Has anyone got this to work? I have never used php on an IIS server before, I would normally use Apache only my client is using IIS.

If there is a solution it would be great to know.

Thanks!

Re: SEO friendly urls in IIS

Posted: Fri Dec 09, 2011 5:18 am
by JeremyBASS
The webconfig is what I posted in the wiki, and it does work. Make sure you have done the changes to the config.php.

Hope that helps.
Cheers -Jeremy