Solved

IIS Website Redirect with Wild Card

Posted on 2014-07-22
6
254 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 500 total points
ID: 40214791
no problem, in the field for pattern, put:

^oldsite/(.*)$

and for the redirect url, put in:

/newsite/$1
0
Free NetCrunch network monitor licenses!

Only on Experts-Exchange: Sign-up for a free-trial and we'll send you your permanent license!

Here is what you get: 30 Nodes | Unlimited Sensors | No Time Restrictions | Absolutely FREE!

Act now. This offer ends July 14, 2017.

 
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

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

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
Australian government abolished Visa 457 earlier this April and this article describes how this decision might affect Australian IT scene and IT experts.
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

690 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