Questions tagged [rewritepath]

Redirects a request for a resource to a different path than the one that is indicated by the requested URL. One of the uses of `RewritePath` is to strip session IDs from URLs.

Redirects a request for a resource to a different path than the one that is indicated by the requested URL.

One use of RewritePath is to stripe session IDs from URLs when using websites with no cookies.

13 questions
5
votes
0 answers

HttpContext.RewritePath breakes buildin IIS gzip

Hello. I am using HttpContext.RewritePath to direct request to inner site folders depending from request and host. Problem: When I do any request that requires RewritePath for any static file that is cached and GZIPped by IIS, I get in response…
Omnik
  • 161
  • 9
4
votes
1 answer

Web.config client cache settings does not apply for rewritten by HttpContext.RewritePath path

We are using system of hidden internal sites. For hiding path we are using HttpContext.RewritePath. There is also a system for uploading photos that generates new name, and photo has no chance to change. We want to use client cache for such…
Omnik
  • 161
  • 9
3
votes
2 answers

Url Rewriting for images

I'm trying to figure out how to enable short URL's for images on the website using Application_BeginRequest. Currently, to open an image I have to use full URL like this: http://mywebsite.com/ViewImage.aspx?album=123&id=456 I want the images to be…
SharpAffair
  • 5,558
  • 13
  • 78
  • 158
2
votes
1 answer

Path rewrite on post data to WCF service

Let's assume that i have simple WCF service defined [OperationContract, WebInvoke(Method = "GET", UriTemplate = "*")] string TestMe () and simple http module to rewrite urls context.BeginRequest += (s,e)=>{ var ctx = HttpContext.Current; var…
Tamir
  • 2,503
  • 16
  • 23
2
votes
1 answer

How do I access the session in order to do a rewrite?

I'm trying to use the HttpContext.Current.RewritePath method to serve up different versions of an application to different customers. I would love to be able to look at the HttpContext.Current.Session object to know who it is making the request. …
Jason Thompson
  • 4,643
  • 5
  • 50
  • 74
2
votes
0 answers

RewritePath not working in IIS 7.5 integrated mode

I got an issue when using HttpContext.RewritePath in HttpModule for URL rewriting. Environment: Windows Server 2008 R2, IIS 7.5 integrated mode, .Net 4.0 In my project, most URLs will be rewritten to the same aspx page(Handler.aspx). The aspx page…
Eric
  • 33
  • 4
2
votes
0 answers

Script service returns 405 on VS dev server when using HttpContext.RewritePath()?

I seem to encounter a very specific problem, apologies for length of question. I have a script service physically residing at /somepath/service.asmx. I am using a url rewriting module (UrlRewritingNet v2.0) to rewrite calls from /service.asmx to my…
tsemer
  • 2,959
  • 3
  • 29
  • 26
2
votes
0 answers

Using HttpContext.RewritePath() with static files

We use HttpContext.RewritePath() to rewrite the path to static files. We do this to be able to virtualize the location of the static files on the server. When we do so, IIS seems to behave strangely by sometimes not compressing the content of the…
sboisse
  • 4,860
  • 3
  • 37
  • 48
1
vote
2 answers

A question about URL Rewrite in .NET

The real url is http://www.example.com/site.aspx?site=google.com i want to the rewrite result more friendly. like this: http://www.example.com/google.com in C# code, i don't want to use third-party lib only use RewritePath method or some code
alex
  • 11
  • 1
1
vote
1 answer

ASP.Net Context.RewritePath does not work when original URL contains query string

I am writing IHttpModule to allow friendly URL access to our one of the detail page. When user is trying to access detail page using http://xyx.com/hotels/123/hotel-name.aspx page, re-write rule is going to applied in IHttpModule's OnBeginRequest…
1
vote
4 answers

RewritePath instead of return view in MVC

Is there a way to rewrite the path displaying a different view instead of RedirectToAction or Redirect? I don't want the url to change, but notice the regular RewritePath cannot be "returned", so the action actually keeps going after it! public…
Ayyash
  • 4,257
  • 9
  • 39
  • 58
0
votes
1 answer

When the target of a .NET HttpModule RewritePath call is a PHP file the $_POST array is empty

We have an application running on IIS 6 which uses a custom HttpModule to rewrite urls. This works great (well done us) except in the case where the Context.RewritePath destination is a .php file. The php file is executed as expected, however the…
jammus
  • 2,540
  • 23
  • 28
0
votes
1 answer

How to remove/hide the default page (default.aspx or index.aspx) from the domain name URL with ASP.NET 3.5

My requirement is as our SEO professional suggests www.example.com/index.aspx should be loaded as www.example.com for google index Canonical Issue I also like to mention because of shared server we can’t access IIS server, and support people are not…
Alvin
  • 11
  • 4