afranklin
09-16-2011, 03:02 AM
Hi,
I am trying to redirect any invalid links on my site to the homepage. I have the following web.config file which redirects to /contact but I can't figure out what path to use to redirect to the homepage. I have tried the full url and variations- please can anyone help?:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite All" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/contact" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Thanks!
I am trying to redirect any invalid links on my site to the homepage. I have the following web.config file which redirects to /contact but I can't figure out what path to use to redirect to the homepage. I have tried the full url and variations- please can anyone help?:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Rewrite All" stopProcessing="true">
<match url="^(.*)$" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/contact" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Thanks!