RewritePath Method (String, String, String, Boolean)
Collapse the table of content
Expand the table of content

HttpContext.RewritePath Method (String, String, String, Boolean)

Note: This method is new in the .NET Framework version 2.0.

Assigns an internal rewrite path with additional path and query string information.

Namespace: System.Web
Assembly: System.Web (in system.web.dll)

public void RewritePath (
	string filePath,
	string pathInfo,
	string queryString,
	bool setClientFilePath
public void RewritePath (
	String filePath, 
	String pathInfo, 
	String queryString, 
	boolean setClientFilePath
public function RewritePath (
	filePath : String, 
	pathInfo : String, 
	queryString : String, 
	setClientFilePath : boolean



The internal rewrite path.


Additional path information for a resource.


The request query string.


true to set the client file path to the value of the filePath parameter; otherwise false.

Exception typeCondition


path is not within the current application's root directory.


filePath is not within the current application's root directory.

The filePath parameter does not include the pathInfo parameter content. For the URL, the filePath parameter is, and the pathInfo parameter is tail.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

© 2016 Microsoft