?
Solved

HTTP  Redirect on IIS

Posted on 2011-10-18
5
Medium Priority
?
261 Views
Last Modified: 2012-05-12
I want to redirect users . I have  a weird request ., If  the  user types  Http://Nahtest/website1 or  Http://nahtest  
I want it to be  redirected to http://nahtest 
Is it possible to do on IIS    withour coding  or can somebody help me with code
0
Comment
Question by:AkilaRamesh
5 Comments
 
LVL 18

Accepted Solution

by:
irweazelwallis earned 1600 total points
ID: 36986147
yes you can with a simple bit of HTML


<HTML>
<HEAD>

<meta HTTP-EQUIV="REFRESH" content="0; url=http://www.yourdomain.com/index.html">

</HEAD>
<BODY>

</BODY>
</HTML>


browse to the inetpub\wwwroot folder

create a text file called redirect.html
add the following code into a simple html file
then under the website in IIS set redirect.html as the default page
0
 
LVL 18

Expert Comment

by:irweazelwallis
ID: 36986571
or you could set up a CNAME record in DNS that points from one to the other
0
 
LVL 8

Expert Comment

by:vinsvin
ID: 36990694
To redirect requests to another Web site or directory
1.
In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.
Click the Home Directory, Virtual Directory, or Directory tab.
3.
Under The content for this source should come from, click A redirection to a URL.
4.
In the Redirect to box, type the URL of the destination directory or Web site. For example, to redirect all requests for files in the Catalog directory to the NewCatalog directory, type /NewCatalog.
To redirect all requests to a single file
1.
In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.
Click the Home Directory, Virtual Directory, or Directory tab.
3.
Under The content for this source should come from, click A redirection to a URL.
4.
In the Redirect to box, type the URL of the destination file.
5.
Select the The exact URL entered above check box to prevent the Web server from appending the original file name to the destination URL.
You can use wildcards and redirect variables in the destination URL to precisely control how the original URL is translated into the destination URL.
You can also use the redirect method to redirect all requests for files in a particular directory to a program. Generally, you should pass any parameters from the original URL to the program, which you can do by using redirect variables.
To redirect requests to a program
1.
In IIS Manager, expand the local computer, right-click the Web site or directory you want to redirect, and click Properties.
2.
Click the Home Directory, Virtual Directory, or Directory tab.
3.
Under The content for this source should come from, click A redirection to a URL.
In the Redirect to box, type the URL of the program, including any redirect variables needed to pass parameters to the program. For example, to redirect all requests for scripts in a Scripts directory to a logging program that records the requested URL and any parameters passed with the URL, type /Scripts/Logger.exe?URL=$V+PARAMS=$P. $V and $P are redirect variables.
4.
Select the The exact URL entered above check box to prevent the Web server from appending the original file name to the destination URL.
0
 

Author Comment

by:AkilaRamesh
ID: 37071933
i already alloetd the points  and accepted  solution 2 weeks ago . This still  comes up as abandoned question .
irweazelwallis  solution  is what i used
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question