Redirect from DNS entry

Topics: User Forum
Oct 22, 2008 at 5:36 AM
Ok, this really isn't sharepoint specific (and I'm sure this is quite easy).

I want to create DNS entries on my network to point to the same server (ex.  Projects and Projects2 would both point to the same ip address).  I then want the isapi filter to REDIRECT to a different server/page.

For example:

http://Projects  would redirect to   http://mysharepointsite/mysite/whatever.aspx

However I don't want something like http://website1/Projects to redirect anywhere (only specific DNS entries).

I wrote what I thought would work but it only picks up the part of the string after the DNS entry

RedirectRule     ^/(?i)projects\/$                      http://mysharepointsite/mysite/whatever.aspx                        [R]

Can someone help me do this (hopefully that made sense)?

Thanks in advance,

Oct 22, 2008 at 5:59 AM
I think that I just needed to add a condition, but please correct me if I'm wrong.

RewriteCond     %{HTTP_HOST} (?i)projects
RedirectRule     ^/                        http://mysharepointsite/mysite/whatever.aspx                 [R]

So anything that comes to the server as http://projects (with case insensitivity) will be redirected to the sharepoint site.  I'll put this onto a test server tomorrow to see if it acts as expected.
Oct 22, 2008 at 2:42 PM

yes, I think so.

But if HTTP_HOST is Projects2 or Projects3, it will match that RewriteCond.

You need beginning-of-string and end-of-string markers if you want to constrain it to an exact match.

RewriteCond     %{HTTP_HOST} ^(?i)projects$


Oct 22, 2008 at 2:56 PM
Great.  Thanks!