Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

IIS7 how to redirect to another site and keep same URL

Posted on 2012-03-27
8
Medium Priority
?
1,808 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 334 total points
ID: 37771116
0
 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 666 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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 19

Assisted Solution

by:Albert Van Halen
Albert Van Halen earned 666 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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…

715 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