Home ISAPI Redirect 3 Filter 301 Redirect with subdomain
Reply: 0

ISAPI Redirect 3 Filter 301 Redirect with subdomain

user1811
1#
user1811 Published in July 23, 2018, 9:58 am

I'm very new in terms of writing rules for ISAPI Rewrite 3 from Helicon (licensed version) to be used for IIS6. I need to write 90+ rules for different pages from "subdomain.domain.com" to "www.domain.com", and I'm not very familiar with RegEx patterns. Unfortunately, these sites don't mirror, so doing a simple query string append won't work.

Example: Redirect "http://subdomain.domain.com/products/product.aspx?id=42" to "http://www.domain.com/productgroup/productinfo"

I have a pretty good start on it, however the furthest I've gotten is to get a specific page redirect to work. I need to get it down to the specific ID for some of these pages to redirect differently. Currently, the code I have for the web page redirect to Google (just for testing purposes) is

# Helicon ISAPI_Rewrite configuration file
# Version 3.1.0.102

RewriteEngine on
RewriteRule ^(subfolder.html)/?(.*)$ http://www.google.com/ [NC,R=301,L]

NOTE: I just created a simple website with the following pages: - /index.html - /subfolder/subfolder.html - /subfolder/subfolder2.html - /subdir/subdir.html

According to the previous code, "/subfolder/subfolder.html" redirects to Google and the others show the page normally. For testing purposes, I've been trying to append "id=1" to redirect to YouTube and "id=2" to redirect to Facebook, and neither of those are working at the moment. The code for that is

RewriteRule ^(subfolder2.html\?id=1)$ http://www.youtube.com/ [NC,R=301,L]
RewriteRule ^(subfolder2.html\?id=2)$ http://www.facebook.com/ [NC,R=301,L]

All I need is to get a pattern that works, then I can modify it from there to make it work for the rest of the pages.

Thank you for any responses!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.322717 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO