IIS 301 redirect syntax help

IIS 301 redirect syntax help

am 04.09.2007 18:41:31 von darrel

We have two domain names pointed at our site. We want to 'kill' one of the
domains by telling IIS to 301 redirect it.

That's simple enough to do by grabbing the host headers and then changing
the HOME directory for the old site in IIS to use 'a redirection to a url'
and then check the 'permananet redirection...' option.

However, we want to redirec to the exact URL.

For instance:

ourolddomain.com/path1/path2
should redirect to
ournewdomain.com/path1/path2

ourolddomain.com/path1/?querystring
should redirect to
ournewdomain.com/path1/?querystring

etc.

We want to redirect the entire path, in otherwords.

Looking at this tutorial:

http://www.mcanerin.com/EN/articles/301-redirect-IIS.asp

It appears that we should be able to use a wildcard asterisk:

ourolddomain.com/*

however, that literally redirects to that url (with the asterisk) and that,
of course, gives us a 401 error. Can anyone help with the syntax to get this
working?

-Darrel

Re: IIS 301 redirect syntax help

am 04.09.2007 22:38:21 von Kristofer Gafvert

Hello,

Try to redirect to the following:

http://ourolddomain.com$V$Q

Make sure you check:

The exact URL entered above
A permanent redirection for this resource

I think this should catch everything.

Hope this helps.

--
Regards,
Kristofer Gafvert
http://www.gafvert.info/iis/ - IIS Related Info


darrel wrote:

>We have two domain names pointed at our site. We want to 'kill' one of the
>domains by telling IIS to 301 redirect it.
>
>That's simple enough to do by grabbing the host headers and then changing
>the HOME directory for the old site in IIS to use 'a redirection to a url'
>and then check the 'permananet redirection...' option.
>
>However, we want to redirec to the exact URL.
>
>For instance:
>
>ourolddomain.com/path1/path2
>should redirect to
>ournewdomain.com/path1/path2
>
>ourolddomain.com/path1/?querystring
>should redirect to
>ournewdomain.com/path1/?querystring
>
>etc.
>
>We want to redirect the entire path, in otherwords.
>
>Looking at this tutorial:
>
>http://www.mcanerin.com/EN/articles/301-redirect-IIS.asp
>
>It appears that we should be able to use a wildcard asterisk:
>
>ourolddomain.com/*
>
>however, that literally redirects to that url (with the asterisk) and
>that, of course, gives us a 401 error. Can anyone help with the syntax to
>get this working?
>
>-Darrel

Re: IIS 301 redirect syntax help

am 05.09.2007 16:15:00 von darrel

> http://ourolddomain.com$V$Q

Aha! Thanks! That works perfectly.

-Darrel