iis 7 - Create a Global IIS 7 rewrite rule -


I have a wildcard record ( * and *. * ) Indicating my dev machine for my domain, in fact, any subdomain that is not www indicates my god machine (leaving the route).

I should never want to be my god machine or search engine.

What I would like to do, it is easy to set a global URL rewrite rule like this:

  & lt; Rule name = "global robots.txt rewrite" stop processing = "true" & gt; & Lt; Mail url = "^ robot \ .txt" ignore = "true" /> & Lt; Action type = "rewrite" url = "http: //localhost/robots.txt" /> & Lt; / Rules & gt;  

The above rules will not work; Although the following redirect rule does:

  & lt; Rule name = "global robots.txt redirect" stopProcessing = "true" & gt; & Lt; Mail url = "^ robot \ .txt" ignore = "true" /> & Lt; Conditions & gt; & Lt; Input = "{HTTP_HOST}" pattern = "^ localhost $" reject = "true" /> & Lt; / Status & gt; & Lt; Action Type = "Redirect" url = "http: //localhost/robots.txt" /> & Lt; / Rules & gt;  

.. but I'm not sure that 301 redirect on robots.txt actually works for search engines.

This attempt really looks like an old post, but I am getting the answer when I get the answer.

  Lt; Rule name = "Reject Robot" StopProcessing = "True" & gt; & Lt; Mail url = "robots.txt" /> & Lt; Conditions rational group = "matching all" track alps = "false" & gt; & Lt; Input = "{HTTP_HOST}" pattern = "www" reject = "true" /> & Lt; / Status & gt; & Lt; Action type = "rewrite" url = "robots_disallow.txt" /> & Lt; / Rules & gt; The  

robots_disallow.txt file contains the following:

  User-agent: * Disclaimer: /  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -