Problems with asp.net level URL rewrite

B

baroque Chou

Thanks for the help available on msdn, I have succesful done the
rewrite job.
But there are 2 problems arise:
1.when I try to rewrite the url from say:
www.yoursite.com/beverages.aspx to
www.yoursite.com/products/ListProductsByCategory.aspx?CategoryID=1
will result in a partial missing of images and css which are packaged
inside products folder.

and if I rewrite from www.yoursite.com/products/beverages.aspx to
www.yoursite.com/products/ListProductsByCategory.aspx?CategoryID=1
all images and css works
any solutions? because I would like keep the url as short as possiable.

2.How to rewrite url without extension? e.g.
www.yoursite.com/beverages
because the url rewrite is done at asp.net engine level, IIS will
hardly route to it since no signs of infomation tell what itself is.
 
B

Bruce Barker

the browser does not know about the rewrite. so when your page has

<img src="foo.gif">

the browser requests

www.yoursite.com/foo.gif

you can create a site images vdir

www.yoursite.com/images

and change refs to:

<img src="/images/foo.gif">

if you want the images in your project, then remap image extensions to
asp.net, then have the urlrewrite do it. note: having asp.net serve the
images has a performance cost compared to iis directly doing it.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top