?
Solved

IIS Website Redirect with Wild Card

Posted on 2014-07-22
6
Medium Priority
?
256 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
[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
  • 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 2000 total points
ID: 40214791
no problem, in the field for pattern, put:

^oldsite/(.*)$

and for the redirect url, put in:

/newsite/$1
0
Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

 
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 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

770 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