Question

I'm using bellow web.config to redirect requests to a another folder. But the problem is requests coming to files want get redirected.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>  
<system.webServer>
    <httpRedirect enabled="true" destination="http://www.mysite.com/ppc/" />
</system.webServer>
</configuration>

example http://www.mysite.com/original/ to http://www.mysite.com/ppc/ works

but http://www.mysite.com/original/a.php to http://www.mysite.com/ppc/ does not works.

It ended up going to http://www.mysite.com/ppc/a.php

Please help.

Was it helpful?

Solution

I found the solution. We have to use the exact destination option also.

<httpRedirect enabled="false" destination="http://www.mysite.com/ppc/" exactDestination="true" childOnly="true" />

OTHER TIPS

Try using the IIS URL Rewrite Module rather than issuing redirects or use url rewrite to do the redirects on pattern matches.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top