Solved

IIS Website Redirect with Wild Card

Posted on 2014-07-22
6
249 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
ID: 40212462
try this:

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

Author Comment

by:ncomper
ID: 40213893
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
ID: 40214791
no problem, in the field for pattern, put:

^oldsite/(.*)$

and for the redirect url, put in:

/newsite/$1
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 5

Author Comment

by:ncomper
ID: 40218718
Now the site just re-directs to:

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

Accepted Solution

by:
c l earned 500 total points
ID: 40220249
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
ID: 40258098
The above setup was correct, i just needed to find the correct location within IIS to ensure this took place
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.

895 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

14 Experts available now in Live!

Get 1:1 Help Now