This is not a direct answer, but it can be useful, though, as Sitecore throws a couple of tricks into the mix, doing what (I think) you want to achieve.
From memory...
The language portion of the URL is removed by the strip language pipeline processor if (and only if) the linkmanager is installed with LanguageEmbedding 'always' or 'asNeeded'. If it is set to never, if it does nothing for the URL in HttpRequest. This can go wrong with your path comparison if you compare a pathless path with the path prefix from LinkManager.
You can add a pipeline step to the stripLanguage step, which adds the incoming URL as you want to the dictionary in HttpRequest.
public class StoreOriginalRequestUrl : PreprocessRequestProcessor { public override void Process(PreprocessRequestArgs args) { args.Context.Items["OriginalRequestUrl"] = args.Context.Request.RawUrl; } }
... you can select this at a later stage after the element recognizer. I assume this is what you are doing - comparing the request URL to the context URL from Linkmanager.
I think you can parse themanmanager link, which returns the Url string as a Uri object and compare the path there. It seems to work better when you use the full URL, so maybe change the UrlOptions returned from GetDefaultOptions () to provide it.
Floor
source share