I do not how to explain my problem clearly. Here is the example.
http://www.mysite1.com/people.aspx is sent to http://www.mysite.com/?tabid=58 and it works perfectly and no addtional urlrewrite rule is required (only add humanfriendURL attribute to the config file).
Now I want to transfer a value to a page/module:
http://www.mysite1.com/people.aspx?lastname=Joe, and it works perfectly. I want to get a friendly URL, then by using urlfriend:
http://www.mysite1.com/people/joe.aspx and it works greatly without any problem when applying the rule
*/people/(.*)_.aspx ==> ~/Default.aspx?TabID=58&lastname=$1
Now problem is coming out if I have multiple portals and I have the same tabPath but the tabID is different:
http://www.mysite2.com/people.aspx is sent to http://www.mysite1.com/?tabid=99
To get the same firendly URL, I want to get:
Http://www.mysite2.com/people/mark.aspx
If I write the rule for multiple porals:
*/people/(.*).aspx ==> ~/people/?lastname=$1
it does not work because the people folder is not founded.
I know there are two ways which can work out:
1. if I write the RewriteRule one by one:
mysite1.com/people/.(*).asp ==> mysite1.com/?tabid=58&lastname=$1
mysite2.com/people/.(*).asp ==> mysite2.com/?tabid=99&lastname=$1
However I do not want to add the rules in hard code one by one.
2. Setup a real file in real folder in website as /people/default.aspx, and setup one single rewrite rule for all portals as
*/people/(.*).aspx ==> ~/people/?lastname=$1
When the real file /people/default.aspx receives a request, it will look for the portal ID/alias by parsing the URL, then look for the tabID for the tab in the portal, then finally redirect the request to portalURL/?tabid=xx&lastname=xxx
I think the URLRewrite module can parse the URL for two times:
1st time: site.com/people/joe.aspx ==> site.com/people.aspx?lastname=joe
2nd time: site.com/people.aspx?lastname=joe ==> site.com/tabid=xxx&lastname=joe
Is any other better way to work it out?
Thank you!
|