Solved

IIS Website Redirect with Wild Card

Posted on 2014-07-22
6
251 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Learn by example how to specify CSS selectors for Selenium WebDriver test automation software.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

856 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