Solved

IIS7 how to redirect to another site and keep same URL

Posted on 2012-03-27
8
1,522 Views
Last Modified: 2012-05-29
I am hosting a website on an IIS7 windows server and I have a URL like this:

www.mywebsite.com/blog

I would like to redirect this to another external website say:
www.anothersite.com

However I would still like www.mywebsite.com/blog to remain in the browser address bar so it appears the user is still on the same website.

Can someone please explain how this can be achieved via IIS?
0
Comment
Question by:mike99c
  • 4
  • 3
8 Comments
 
LVL 11

Accepted Solution

by:
rajvja earned 167 total points
ID: 37771116
0
 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 333 total points
ID: 37772958
Have a look at the URL Rewrite Module.
See a nice tutorial here : http://learn.iis.net/page.aspx/461/creating-rewrite-rules-for-the-url-rewrite-module/
0
 

Author Comment

by:mike99c
ID: 37773029
I have looked at the rewrite rule but I need the URL to to be unchanged in the browser window.
0
 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 333 total points
ID: 37773055
I use it myself too.
I have url like http://mysite/article/1st_article which redirects to http://mysite/ViewArticle.aspx?ArticleText=1st%20article

It doesn't show the 'ugly' url in the browser...
0
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

Author Comment

by:mike99c
ID: 37773082
Can you please provide me with your rewrite rule as I am not clear how you can make it maintain the original URL.
0
 
LVL 19

Expert Comment

by:Albert Van Halen
ID: 37773874
Here the exact rule I'm using.
  <rewrite>
  <rules>
    <rule name="Rewrite to article.aspx">
      <match url="^article/([\._0-9a-z-]+)" />
      <action type="Rewrite" url="ShowArticle.aspx?title={R:1}" />
    </rule>
  </rules>
</rewrite>

Open in new window

0
 

Author Comment

by:mike99c
ID: 37808364
Hi
Thanks for the response, have installed the URL rewrite module, but the problem is that I'm not great with regular expressions
I just want to substitue
www.mywebsite.com/blog
with
www.anothersite.com

Could you point me in the right direction?
Cheers
0
 

Author Comment

by:mike99c
ID: 37808658
I have tried the following:

            <rewrite>
              <rules>
                  <rule name="Rewrite to http://anothersite.com">
                    <match url="/blog" />
                    <action type="Rewrite" url="http://anothersite.com" />
                  </rule>
              </rules>
            </rewrite>

When I click on www.mywebsite.com/blog, nothing happens.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

The task A number given should be formatted for easy reading by separating digits into triads. Format must be made inline via JavaScript, i.e., frameworks / functions are not welcome. So let’s take a number like this “12345678.91¿ and format i…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

930 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now