Here is a sample web.config file to redirect any requests to http://site.com to http://www.site.com. <?xml version=”1.0″ encoding=”UTF-8″?> <configuration> <system.webServer> <rewrite> <rules> <rule name=”Add www” patternSyntax=”Wildcard” stopProcessing=”true”> <match url=”*” /> <conditions> <add input=”{HTTP_HOST}” pattern=”www.site.com” negate=”true” /> </conditions> <action type=”Redirect” url=”http://www.site.com/{R:1}” /> </rule> </rules> </rewrite> </system.webServer> </configuration>
URL Rewrite 301 Redirect For a Single Page
Want to set up a 301 redirect for a certain single page on your site to send users to a different URL? Below is a very simple web.config file I created on an IIS7 server to demonstrate performing this action. The rule looks for a URL of http://<yourdomain.com>/folder1/default.aspx and, if found, returns an HTTP Status code […]
cytanium, Development/Coding, Hosting, IIS, OrcsWeb, tip, WindowsSending Authenticated Email from ASP.NET C#
I previously wrote an article on what code you can use to send email using ASP.NET C#. That article assumed that the local SMTP service was allowing anonymous relay for code on the local server (i.e. 127.0.0.1). Below is a slightly revised code sample allowing for authentication against an SMTP server in case your server […]
ASP.NET, cytanium, Development/Coding, Email, Hosting, OrcsWebManaged Hosting Tip: Securing Your Site With ASP.NET
Since we perform managed shared hosting, managed dedicated hosting, and managed cloud hosting at OrcsWeb, we sometimes get involved assisting clients with certain situations related to their site’s code, and we try to assist (within reason) even if the situation has nothing to do with the servers or hosting services. A fairly regular need that […]
ASP.NET, Hosting, IIS, OrcsWeb