Hi Everyone, I am working on a project that uses an HTTP Handler to dynamically resize/cache images, along with an HTTP Module which ensures SSL usuage on specified pages. The project is an E-Commerce site which also dynamically creates all the Meta data, page
titles, and image alternate tags from info pulled from the database.. needless to say being nice to search engines is a requirement of this project. So.. On some pages, mostly product browsing pages, my URLs have 3 variables in the querystring. http://localhost/myproject/products.aspx?department=1&category=2&product=123
.. not good for crawling.. So, I developed a method in my HTTP module to rewrite it to http://localhost/myproject/department/1/category/2/product/123/products.aspx which should be nicer to a crawler. I am experiencing problems with my links that have the ~
in them, which I searched the forum and I can see whats up with that. So instead of Context.RewritePath() I tried Server.Transfer() and it seems to work well. AFAIK there is no redirect (which i MUST avoid, as search engines get pissed by that?). Can someone
confirm this? is Server.Transfer() ok as far as search engines are concerned? Is Server.Transfer() ok as far as performance (compared to RewritePath that is). If Server.Transfer() is slow compared to Context.RewritePath() is there a graceful way of making
the ~ links translate properly? If Transfer() is fine, I will just stick with that though :) Thanks in advance !
Can you replace the tilde with some kind of a base url? How about a regex that does that? I'd recommend RewritePath over Server.Transfer. The reason is RewritePath doesn't cause a detour and is therefore faster. Also, it allows you to "obfuscate" the real URL.
Server.Transfer sends a 302 and reveals the real URL. Note that Server.Transfer throws a ThreadAbortException every time. Well, it's the result of calling Response.End, to be more precise. If your site facilitates a lot of traffic throwing too many exceptions
might create overhead (exceptions are expensive). It's questionable if search engines hate redirects. Most people believe (including myself) that SEs hate too many excessive redirects, but this is not carved in stone. Same goes for the notion that SEs dislike
dynamic content---there's no proof either way.
I suspected that. Ok, I am going to have to create a helper function to translate that ~ into the real application root. i am not sure why it appends the path after the fake URL.
Hmm I am having trouble finding a way to determine if the requested file has the ~ in it.. I would think I would have to add a .* mapping in my IIS configuration for that site to the asp_net.isapi so that all requests will run through it, which I can do. However,
I still cant seem to capture if the requested file/image has a "~" in it, so I can replace it with the true applicaiton path (instead of the rewritepath+the app path) I suppose I could just make everything /images/imagname.jpg instead of ~/images/imagename.jpg
but I would really like to keep it in the Application Root instead of the server root
Member
243 Points
1185 Posts
RewritePath / Server.Transfer (~ issues in Module)
Apr 28, 2004 09:15 PM|Sharbel_|LINK
Member
130 Points
293 Posts
Re: RewritePath / Server.Transfer (~ issues in Module)
Apr 28, 2004 10:07 PM|MilanNegovan|LINK
http://www.AspNetResources.com
ASP.NET With Emphasis On Web Standards
Member
243 Points
1185 Posts
Re: RewritePath / Server.Transfer (~ issues in Module)
Apr 29, 2004 01:47 AM|Sharbel_|LINK
None
0 Points
110 Posts
Re: RewritePath / Server.Transfer (~ issues in Module)
Apr 29, 2004 06:56 AM|intesoft|LINK
ASPAccelerator.NET - Fewer bytes, faster pages
ASPRedirector.NET - Put friendly URLs on your site
Member
243 Points
1185 Posts
Re: RewritePath / Server.Transfer (~ issues in Module)
Apr 29, 2004 09:07 AM|Sharbel_|LINK
Member
243 Points
1185 Posts
Re: RewritePath / Server.Transfer (~ issues in Module)
Apr 29, 2004 10:52 AM|Sharbel_|LINK