Solved

IIS Website Redirect with Wild Card

Posted on 2014-07-22
6
248 Views
Last Modified: 2014-08-13
Hi all,
   Prob a very quick one here. Client has the following site and would like a re-direct (IIS Server)

Previous - WWW.MYDOMAIN.COM/oldsite
New         - WWW.MYDOMAIN.COM/newsite

they want to include everything from after the old site as well:
WWW.MYDOMAIN.COM/oldsite/MyFile.pfd
WWW.MYDOMAIN.COM/newsite/MyFile.pdf

Requested URL: Matches the Pattern
Using: Regular Expression
Pattern: ^oldsite

Action Type: Redirect
Redirect URL: /newsite/
Redirect type: Permanent (301)

Thanks,
0
Comment
Question by:ncomper
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:c l
Comment Utility
try this:

RewriteRule ^oldsite/(.*)$ /newsite/$1 [R=301,NC,L]
0
 
LVL 5

Author Comment

by:ncomper
Comment Utility
Thanks for that,
   It seems i'm just being Very Special here.......

I am trying to complete this using IIS 7.5 using the GUI.

I have the option to create a new rule on either the Root or the sub folder, i have tried to add this to the Root URL Re-write (inbound rule) but i must be missing something.

Thanks,
0
 
LVL 2

Assisted Solution

by:c l
c l earned 500 total points
Comment Utility
no problem, in the field for pattern, put:

^oldsite/(.*)$

and for the redirect url, put in:

/newsite/$1
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Author Comment

by:ncomper
Comment Utility
Now the site just re-directs to:

www.domain.com/newsite/$1
0
 
LVL 2

Accepted Solution

by:
c l earned 500 total points
Comment Utility
get rid of $1 on the second field, I'm use to editing the file directly, my apologies :)
0
 
LVL 5

Author Closing Comment

by:ncomper
Comment Utility
The above setup was correct, i just needed to find the correct location within IIS to ensure this took place
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
The viewer will learn how to dynamically set the form action using jQuery.
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…

743 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

19 Experts available now in Live!

Get 1:1 Help Now