iis 7 - IIS7 or .Net 301 Redirects from 1 domain to another -


I have 2 domains for the question, I will call them www.old.com and www.new.com Both URLs are pointing to the same IIS7 site example. I need to raise it so that when someone goes to www.older.com, they are redirected to www.new.com 301.

The hard part is that I am rewriting the URL for the pages of the site. Then redirect to www.old.com/about.aspx www.new.com/ To work with the IIS 7 URL rewrite rules also means that www.new.com/About.aspx www.new.com Is redirected to /. This is fine and there is no big deal.

My issue is how do I redirect the main domain without having to rewrite the URL from the main domain?

I do not care if I use a module inside IIS7 or if I want to do it in the .NET code.

I think I'll use a rewrite module for something like this. Actually it is saying that if your new domain is not going, then redirect it to it. Pass URL which will be left by your custom research module

  & lt; Rewrite & gt; & Lt; Rules & gt; & Lt; Rule name = "customRule" & gt; & Lt; Mail url = "(. *)" / & Gt; & Lt; Conditions & gt; & Lt; Input = "{HTTP_HOST}" pattern = "^ www \ .new \ .com $" negate = "true" /> Add & lt; / Status & gt; & Lt; Action Type = "Redirect" url = "http://www.new.com/{R:1}" /> & Lt; / Rules & gt; & Lt; / Rules & gt; & Lt; / Rewrite & gt;  

Hope it helps!


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -