Click here to Skip to main content
15,921,169 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Will try and keep it as short as possible. I have a site which shows data for 13 dealers of a company. For each dealer they have created a subdomain. Ex www.mysite.com is the main domain then for each dealer they have a sub domain like www.dealername.mysite.com. There is facility from the admin section of the site to add a new dealer. From the admin section the dealer is created and we get a sub domain ex : www.newdealer.mysite.com. I added this as a new site in IIS and i can see the home page but for all other pages they have used URL re writing. http://www.ubaidh.mercedes-benzdealers.co.in/home.aspx this is the new subdomain that i have created the home page is visible but for all other pages it gives an error. If you go to about us->Company Profile you will be redirected to http://ubaidh.mercedes-benzdealers.co.in/AboutUs/CompanyProfile.aspx and it gives me an 404 error. but if i do the same for some other dealer like go to the following link http://transcar.mercedes-benzdealers.co.in/home.aspx then go to about -> company profile you will see that the URL is "http://transcar.mercedes-benzdealers.co.in/Pages01/CompanyProfile.aspx" which is achieved using URL re writing. [Not sure how it works] if i change the URL to "www.http://ubaidh.mercedes-benzdealers.co.in/Pages01/CompanyProfile.aspx" it still gives me an error. Can any body help me with this. I am not the one who has developed the application so even i have limited knowledge about the application. The data for the new dealer is automatically added in the tables.
Pages01.aspx,Pages02.aspx,Pages03.aspx exists under the Templates folder in the main site.
This is the code inside the web.config file.
C#
<rewriter>
		<rewrite url="~/MySection/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/AboutUs/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/ContactUs/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages02/(.+).aspx" to="~/Templates/Page02.aspx"/>
		<rewrite url="~/NewCars/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages03/(.+).aspx" to="~/Templates/Page03.aspx"/>
		<rewrite url="~/Footer/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages05/(.+).aspx" to="~/Templates/Template05.aspx"/>
		<rewrite url="~/AfterSalesService/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/Preownedcars/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/FinancingInsurance/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/PartsAccessories/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/SpecialOffers/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
		<rewrite url="~/Careers/(.+).aspx" to="~/AboutUs.aspx"/>
		<rewrite url="~/Pages01/(.+).aspx" to="~/Templates/Page01.aspx"/>
	</rewriter>
Posted
Updated 2-Feb-12 2:20am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900