Need help to write redirection rules...
4 posts
• Page 1 of 1
- lalitmishra1988
-
- Posts: 16
- Joined: 29 Apr 2013, 08:10
Need help to write redirection rules...
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.
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.
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Need help to write redirection rules...
And what would be the landing URL?
- lalitmishra1988
-
- Posts: 16
- Joined: 29 Apr 2013, 08:10
Re: Need help to write redirection rules...
landing URL would be --
https://x.y.z/Test1/Test2/16d291ea-5e2d-4328-89b0-06a81807f927
https://x.y.z/Test1/Test2/16d291ea-5e2d-4328-89b0-06a81807f927
- HeliconAndrew
-
- Posts: 1264
- Joined: 07 Mar 2012, 10:16
Re: Need help to write redirection rules...
Hm... I don't see complete pattern between incoming and landing requests... but the rule should look like:
Regards
Andrew
- 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
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 6 guests