Need help to write redirection rules...

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 16
Joined: 29 Apr 2013, 08:10

Need help to write redirection rules...

12 Jun 2013, 10:17

Hi,

I have to write some rules to redirect users from some URLs to other URL. Please refer below example --

I need to redirect user to the URL like:

https://x.y.z/Test1/Test2/16d291ea-5e2d-4328-89b0-06a81807f927

When he or she enters URLs like:

1. https://x.y.z/Test1/Test2/Test3
2. https://x.y.z/Test1/Test2/A/B/C.aspx?ID=2&Y=7&L=T&D=Test

Please provide your input for the same.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need help to write redirection rules...

12 Jun 2013, 11:32

And what would be the landing URL?

User avatar
Posts: 16
Joined: 29 Apr 2013, 08:10

Re: Need help to write redirection rules...

13 Jun 2013, 01:36

landing URL would be --

https://x.y.z/Test1/Test2/16d291ea-5e2d-4328-89b0-06a81807f927

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: Need help to write redirection rules...

13 Jun 2013, 10:10

Hm... I don't see complete pattern between incoming and landing requests... but the rule should look like:

Code: Select all
RewriteEngine on
RewriteBase /

RewriteCond %{HTTP:Host} ^x\.y\.z$ [NC]
RewriteRule ^([^/]+)/([^/]+)/([^/]+)$ /$1/$2/16d291ea-5e2d-4328-89b0-06a81807f927 [NC,R=301,L]


RewriteCond %{HTTP:Host} ^x\.y\.z$ [NC]
RewriteCond %{QUERY_STRING} ^.*$ [NC]
RewriteRule ^([^/]+)/([^/]+)/.+\.aspx$ /$1/$2/16d291ea-5e2d-4328-89b0-06a81807f927? [NC,R=301,L]


Regards
Andrew

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 6 guests