Solved

IIS7 how to redirect to another site and keep same URL

Posted on 2012-03-27
8
1,730 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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
 

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
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…
Suggested Courses

630 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