Quantcast
Channel: URL Rewrite Module
Viewing all articles
Browse latest Browse all 2482

URL Redirect with exact match problem

$
0
0

Hello,

I have been struggling with a specific pattern matching solution. We have a large site with lots of subdomains. The subdomain URL's have always been easy to match. We we so many site that we have to be careful with redirects so we don't redirect the wrong requests. To make matters worse we have somewhere around 50 rules and I suspect the number of rules is causing issues, but that is for another time. 

Here is the info on my issue. We get requests for company.com as well as www.company.com and need to handle both.

Here is the path I am trying to redirect.

http://company.com/af

or

http://www.company.com/af

I need to be able to grab back references also. I have not been able to match the "af" part without matching more than intended. For example my rule also matches "after", "afghanistan", etc. 

Right now I have this in place.

For conditions I am using http_host and ^(?:www\.)?(company+\.com)$

Under match URL I have af(.*)

This grabs too much and also not enough. For some reason any requests with www.company.com don't get evaluated.

Anyway, I need to evaluate just www.company.com/af and company.com/af as well as the back reference so I can pass that along to the new url. 

I have also tried ^(?:www\.)?(company+\.com)/af$ and the URL match of (.*)

Can anyone help?

Thanks!


Viewing all articles
Browse latest Browse all 2482

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>