Category IIS

URL Redirect in IIS7

In this post I will show you how to setup an URL redirect in IIS 7. In this post I will assume you have some working knowledge of IIS.

Open IIS (Start –> Administrative Tools –> IIS Manager)

Expand your Web Server then right click on Sites and choose Add Web Site.

Give the site a name such as domain.com redirect. Be sure to add something to the name so you will know that it is a redirect if you need to reference it later. Put in a path for the web site. Redirects don’t really use the path but IIS won’t let you add the web site without this. I created a directory in the following location: C:\inetpub\redirects. I alwyas create this and use this location to place all of my redirects in. Put in the desired IP address or leave it on all unassigned and click OK.

Now double click on “HTTP Redirect” the properties will appear.

Put a check next to “Redirect requests to this destination:“. Now type in the URL for the website you want this URL to redirect to. For example you would type http://www.domain2.com here. Now when someone types www.domain.com in their web browser it will redirect them to www.domain2.com.

For “Redirect Behavior” I put a check next to “Redirect all requests to exact destination” and chose Permanent (301) as my Status Code. These options are further explained below.

  • Redirect all requests to exact destination (instead of relative to destination)

Select this option when you want clients to be redirected to the exact URL as speci...

Read More

Troubleshoot “Server Error in ‘/’ Application”

Have you ever setup a website in IIS and then you got this generic error: “Server Error in ‘/’ Application.

This is what I got right after installing SharePoint server 2007, setting up a portal and trying to access the site. Here is what you need to do to get a more detailed error so you can fix the issue. You need change a couple of settings by modifying the web.config file of your website.

Here is how you can locate this file: Open IIS>>right click on your website and choose open>>In the right hand window pane you should see the web.config file>>right click on the web.config file and open it with notepad.

Press ctl+f  to bring up the search box type customErrors to find the line change it from “On” to “Off”

now search for CallStack change this from “false” to “true”

save your webconfig file refresh your web page and you will see a more detailed error. Don’t forget to go back into your web.config file and change the settings back. You don’t want visitors knowing internal information if the web site errors out again.

Read More