Apologies if this has been asked before, but I'm having trouble writing a redirect rule using IIRF and was hoping someone could shed some light on how it worked.

Here's the first rule:

For ANY request that is NOT on port 81, take the subdomain portion of the request and redirect to the https version of the same request (in our servers, port 81 means that it came in on https)

RewriteCond %{SERVER_PORT} !^81$
RewriteCond %{HTTP_HOST} ^(.*)\.MYDOMAIN\.com$       
RedirectRule ^/(.*)$ https://*1.MYDOMAIN.com/$1 [R=301]

The second rule is:

For any request that didn't match the first rule (since it would have redirected), which means it IS coming in on a secure request, see if the request is coming in for a page like this:

https://subdomain.mydomain.com/issues/detail.aspx?IssueID=XXXX (where XXXX is a number)

redirect it to

https://subdomain.mydomain.com/issues/order/XXXX

# /issues/detail.aspx?IssueID=XXXX -> /issuetracker/issues/order/XXXX

RewriteCond %{HTTP_HOST} ^(.*)\.MYDOMAIN\.com$   
RewriteCond ^/(.*)$ ^/issues/detail\.aspx\?IssueID\=([0-9]+)$ [I]
RedirectRule ^/(.*)$ https://*1.MYDOMAIN.com/issuetracker/issues/order/*2

Thank you so much for any help.

link|improve this question
feedback

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
or
required, but never shown

Browse other questions tagged or ask your own question.