Hi all ,
I am workin on a website say www.MyWebsite.com which is similar to a b2b portal . Now here we ve a
number of companies and to each company we are providing a homepage which
will be a dynamic page for all the comapnies.
Now this homepage will be loaded according to the company id passed through querystring
or by some other means.
Now what i want is that i don'nt want to show the querystring value in the url
plus I want to let the company access this page by there company name ...
for example ...
for infosys : the url shoud be www.MyWebsite.com/infosys
for abc : www.MyWebsite.com/abc
something like this in http://www.seekandsource.com : http://snsvo9.seekandsource.com/kebabish/
i think i ve to do URL rewriting .. bt i m nt getting hw to do ...
Can anyone help me ....
tnx & Regards
s_raj0205
john ginzoPosted Jul 23, 2007, 8:50 AM
www.MyWebsite.com/Infosys
Then in the Request event in your global.asa, you can look at the url, realize he is looking for infosys, and then rewrite the url to
www.mywebsite.com/company.aspx?id=1
the user's url in the address bar stays the same even though you are serving them the one with the parameter
John Ginzo
GinzoTech Solutions
www.ginzotech.com
suraj raiPosted Jul 20, 2007, 1:59 AM
Hi John ,
Tnx for d reply ...
I think the way you ve done .. still I need to call the page like this if I
ve understand ur code . For example ..
If the page is : www.MyWebSite.com/Company.aspx?pageid=1
Then atmost in the url Company.aspx will be visible .. rite ...
But wat I want is that ...
The company pages has to be call with a parameter depending on the company but
the url should still display tat perticular company name...
like if I need the details of Infosys ..then url whoud display
www.MyWebsite.com/Infosys
and in reality the displayed page will be www.MyWebSite.com/Company.aspx?pageid=1
if Infosys's company id is 1 .
MOreover the user should be able to display the page by typing www.MyWebsite.com/Infosys
in the address bar .
I just want to know .. is that posible .. if U can give me sum suggesstion wud be
highly appreciated.
Tnx & Regards
s_raj0205
john ginzoPosted Jul 19, 2007, 8:49 AM
http://www.stardeveloper.com/articles/display.html?article=2004022801&page=1
There are also two other ways to do it. You could search the web for examples of writing an ISAPI redirection filter, but that is a little more diffiult, or there is a way in .NET to do the same using httphandlers. However, the code above is currently working on a couple of large websites I have done with no issues.
John Ginzo
GinzoTech Solutions
www.ginzotech.com