URLHelper Class |
Namespace: CMS.Helpers
public class URLHelper
The URLHelper type exposes the following members.
Name | Description | |
---|---|---|
DEFAULT_HTTP_PORT |
Constant for HTTP port.
| |
DEFAULT_HTTPS_PORT |
Constant for HTTPS port.
| |
SYSTEM_QUERY_PARAMETER |
Used in system requests of live site pages, it prevents the system to log statistics or activities, e.g. when dynamic newsletter is generated.
|
Name | Description | |
---|---|---|
AliasPathParameterName |
Alias path query parameter name.
| |
CustomTheme |
Custom theme name.
| |
DefaultTheme |
Default theme name.
| |
Host |
Application's host. Is to be used for customizing host in case of having application behind a proxy.
Can be set via AppSettings's key 'CMSUrlHost'.
| |
LanguageParameterName |
Language query parameter name.
| |
RegExMakeLinksAbsolute |
Make links absolute regular expression.
| |
SSLUrlPort |
Application's SSL URL port.
| |
UrlPort |
Application's URL port.
|
Name | Description | |
---|---|---|
AddHTTPToUrl |
Adds HTTP protocol to URL if it's not contain HTTP or HTTPS.
| |
AddParameterToUrl |
Adds parameter to specified URL.
| |
AddUrlParameter |
Add parameter to query string, queryStringValue MUST start with "?".
| |
AppendQuery |
Appends the given query string to the URL. If the URL already contains query string, merges both.
| |
CheckPrefix |
Checks the URL prefix. If the prefix is present, returns true and removes the prefix from the URL if removePrefix is true.
| |
CheckPrefixes |
Checks the URL prefixes. If one of the the prefixes is present, returns true and removes the prefix from the URL if removePrefix is true.
| |
ClientRedirect |
Performs client redirect.
| |
CombinePath |
Resolves given path to be absolute (combines with given paths).
| |
ContainsProtocol |
Returns true if the URL contains the protocol part.
| |
DomainMatch |
Returns true if the given domain names match.
| |
EnsureHashToQueryParameters |
Replaces {hash} macro by hash code for given query string parameters.
| |
EnsureProperPort |
Sets proper port according to SSL option and custom port.
| |
EnsureURLPrefix |
Ensures that the given URLs has the given prefix
| |
EscapeSpecialCharacters |
Ensures URL without forbidden characters (%, &, #).
| |
ForbiddenCharactersReplacement |
Returns string containing replacement for forbidden characters (chars that can't be used in node alias and in the file system).
| |
ForbiddenURLCharacters |
Returns string containing all forbidden characters that cannot be used in node alias and in the file system.
| |
GetAbsoluteUrl(String) |
Returns the absolute URL (including port) representation for the given relative URL, uses current domain and application path.
| |
GetAbsoluteUrl(String, String) |
Returns the absolute URL (including port) representation for the given relative URL, uses given domain and application path.
| |
GetAbsoluteUrl(String, String, String, String) |
Returns the absolute URL for the given relative URL based on the given paths.
| |
GetAllowedURLCharacters |
Returns regular expression for allowed URL characters.
| |
GetApplicationUrl |
Returns current application URL (absolute), without trailing slashes.
| |
GetApplicationUrl(String) |
Returns the application URL (absolute), without trailing slashes.
| |
GetAppRelativePath |
Returns the relative path for specified URL.
| |
GetDomain |
Returns domain or domain with port if present from specific URL.
| |
GetDomainName |
Returns name (e.g. localhost) without port, www. prefix and application path.
| |
GetFullApplicationUrl |
Returns current application absolute URL.
| |
GetPhysicalPath |
Returns the physical file path that corresponds to the specified virtual path on the web server.
| |
GetProtocol |
Returns protocol from url.
e.g. http, https, ftp, ...
If no protocol found, null is returned.
| |
GetQuery |
Gets the query from URL.
| |
GetQueryValue(String, String) |
Gets the query string value for specified key name.
| |
GetQueryValue(String, String, Boolean) |
Gets the query string value for specified key name.
| |
GetSafeFileName(String, String) |
Returns the safe equivalent to the given file name (with extension).
| |
GetSafeFileName(String, String, Boolean) |
Returns the safe equivalent to the given file name.
| |
GetSafeUrlPart |
Returns the safe part of URL. This method doesn't process complete URL it handles only part of URL.
| |
GetUrlExtension |
Gets the extension for the given URL. Returns the extension with the dot, e.g. ".gif"
| |
GetUrlParameter |
Returns value of query parameter from URL.
| |
GetVirtualPath |
Converts the absolute path to the virtual.
| |
IsAbsoluteUrl |
Returns true if provided URL is absolute and has http or https scheme. False otherwise.
| |
IsAnchor |
Returns true for url's starting with hash (#) character.
| |
IsExcluded(String, String) |
Checks if page with specified relative path is excluded from excluded paths.
| |
IsExcluded(String, String) |
Checks if page with specified relative path is excluded from excluded paths.
| |
IsExcludedCustom |
Checks if page with specified relative path is excluded from excluded paths.
| |
IsExcludedSystem |
Checks if page with specified relative path is excluded from system paths.
| |
IsExcludedSystemEnum |
Checks if page with specified relative path is excluded from system paths and returns the category of the excluded page.
| |
IsLocalUrl |
Returns true if the given URL is local.
| |
IsRootDefaultDocumentRelativePath |
Indicates whether relativePath starting from application root identifies a default document within application root.
The default document is identified by '/default.aspx', '/' or empty string relativePath.
| |
IsSystemPath |
Returns true if the given path is a system path. The path is expected to be lowercase and start with slash, e.g. "/cmsmodules/..."
| |
IsTldDomain |
Returns true if domain is IP address or top level domain e.g localhost
| |
LimitURLReplacements |
Limits multiple replacements, starting and trailing replacements from URL. Can be disabled by app key: CMSLimitUrlReplacement.
| |
LocalRedirect |
Redirects (302 HTTP status code) the response using specified URL in case it is local,
otherwise redirects to ApplicationPath | |
MakeLinksAbsolute(String) |
Returns the absolute representation of the HTML links (image paths ...).
| |
MakeLinksAbsolute(String, String) |
Returns the absolute representation of the HTML links (image paths ...).
| |
MergeQueryStrings |
Merges two query strings. Query string parameters should (but don't have to) start with question mark
but they definitely must omit path part of URL.
| |
PropagateUrlParameters |
Propagates the URL parameters from current URL to the given URL
| |
Redirect |
Redirects the response using specified URL (302 HTTP status code).
| |
RedirectPermanent |
Redirects the response using specified URL using permanent redirection using 301.
| |
RefreshCurrentPage |
Refreshes the current page by doing a redirect to self
| |
RemoveAnchorFromUrl |
Removes the anchor from the given url.
| |
RemoveApplicationPath |
Removes the Application path from the URL.
| |
RemoveExtension |
Removes the potential extension from the given path.
| |
RemoveFirstPart |
Returns the string with first selector removed.
| |
RemoveParameterFromUrl |
Removes specified parameters from the given URL.
| |
RemoveParametersFromUrl |
Removes specified parameters from the given URL.
| |
RemovePort |
Removes the port part from the domain name.
| |
RemovePortFromURL |
Removes the port part from the whole URL.
| |
RemoveProtocol |
Removes the protocol part from the URL.
| |
RemoveProtocolAndDomain |
Removes the protocol and domain part from the URL.
| |
RemoveQuery |
Removes the query from URL.
| |
RemoveTrailingSlashFromURL |
Removes trailing slash from URL.
| |
RemoveUrlParameter |
Remove parameter from query string.
| |
RemoveUrlParameters |
Removes the given URL parameters
| |
RemoveWWW |
Trim www if input text starts with it.
| |
ResolveClientUrl |
Resolves and combine client URL with base URL.
| |
ResolveUrl |
Resolves an application relative URL to the absolute form.
| |
ResponseRedirect |
Redirects the response using specified URL using standard redirection with Response.Redirect.
| |
SeeOther |
Redirects the client to another URL using the GET method (303 H).
| |
TryCreateAbsoluteUrl |
Returns true if provided URL is absolute in platform agnostic manner.
On Windows platform preserves semantics of TryCreate(String, UriKind, Uri).
On Unix platforms it also ensures that relative urls are not considered as absolute file paths.
| |
UnMapPath |
Converts the physical file path to virtual path within the web application.
| |
UnResolveUrl |
Un-resolves the given URL (replaces application path with ~).
| |
UpdateParameterInUrl |
Update parameter in specified URL.
| |
UrlEncodeQueryString |
URL encodes query string in given URL. Needs HttpContext.
| |
UseURLsWithTrailingSlash | Obsolete.
Gets the settings for the URL trailing slash rules.
|