Click or drag to resize
URLHelper Class
Url processing methods.
Inheritance Hierarchy
SystemObject
  CMS.HelpersURLHelper

Namespace: CMS.Helpers
Assembly: CMS.Helpers (in CMS.Helpers.dll) Version: 13.0.131
Syntax
C#
public class URLHelper

The URLHelper type exposes the following members.

Constructors
  NameDescription
Public methodURLHelper
Top
Fields
  NameDescription
Public fieldStatic memberDEFAULT_HTTP_PORT
Constant for HTTP port.
Public fieldStatic memberDEFAULT_HTTPS_PORT
Constant for HTTPS port.
Public fieldStatic memberSYSTEM_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.
Top
Properties
  NameDescription
Public propertyStatic memberAliasPathParameterName
Alias path query parameter name.
Public propertyStatic memberCustomTheme
Custom theme name.
Public propertyStatic memberDefaultTheme
Default theme name.
Public propertyStatic memberHost
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'.
Public propertyStatic memberLanguageParameterName
Language query parameter name.
Public propertyStatic memberRegExMakeLinksAbsolute
Make links absolute regular expression.
Public propertyStatic memberSSLUrlPort
Application's SSL URL port.
Public propertyStatic memberUrlPort
Application's URL port.
Top
Methods
  NameDescription
Public methodStatic memberAddHTTPToUrl
Adds HTTP protocol to URL if it's not contain HTTP or HTTPS.
Public methodStatic memberAddParameterToUrl
Adds parameter to specified URL.
Public methodStatic memberAddUrlParameter
Add parameter to query string, queryStringValue MUST start with "?".
Public methodStatic memberAppendQuery
Appends the given query string to the URL. If the URL already contains query string, merges both.
Public methodStatic memberCheckPrefix
Checks the URL prefix. If the prefix is present, returns true and removes the prefix from the URL if removePrefix is true.
Public methodStatic memberCheckPrefixes
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.
Public methodStatic memberClientRedirect
Performs client redirect.
Public methodStatic memberCombinePath
Resolves given path to be absolute (combines with given paths).
Public methodStatic memberContainsProtocol
Returns true if the URL contains the protocol part.
Public methodStatic memberDomainMatch
Returns true if the given domain names match.
Public methodStatic memberEnsureHashToQueryParameters
Replaces {hash} macro by hash code for given query string parameters.
Public methodStatic memberEnsureProperPort
Sets proper port according to SSL option and custom port.
Public methodStatic memberEnsureURLPrefix
Ensures that the given URLs has the given prefix
Public methodStatic memberEscapeSpecialCharacters
Ensures URL without forbidden characters (%, &, #).
Public methodStatic memberForbiddenCharactersReplacement
Returns string containing replacement for forbidden characters (chars that can't be used in node alias and in the file system).
Public methodStatic memberForbiddenURLCharacters
Returns string containing all forbidden characters that cannot be used in node alias and in the file system.
Public methodStatic memberGetAbsoluteUrl(String)
Returns the absolute URL (including port) representation for the given relative URL, uses current domain and application path.
Public methodStatic memberGetAbsoluteUrl(String, String)
Returns the absolute URL (including port) representation for the given relative URL, uses given domain and application path.
Public methodStatic memberGetAbsoluteUrl(String, String, String, String)
Returns the absolute URL for the given relative URL based on the given paths.
Public methodStatic memberGetAllowedURLCharacters
Returns regular expression for allowed URL characters.
Public methodStatic memberGetApplicationUrl
Returns current application URL (absolute), without trailing slashes.
Public methodStatic memberGetApplicationUrl(String)
Returns the application URL (absolute), without trailing slashes.
Public methodStatic memberGetAppRelativePath
Returns the relative path for specified URL.
Public methodStatic memberGetDomain
Returns domain or domain with port if present from specific URL.
Public methodStatic memberGetDomainName
Returns name (e.g. localhost) without port, www. prefix and application path.
Public methodStatic memberGetFullApplicationUrl
Returns current application absolute URL.
Public methodStatic memberGetPhysicalPath
Returns the physical file path that corresponds to the specified virtual path on the web server.
Public methodStatic memberGetProtocol
Returns protocol from url. e.g. http, https, ftp, ... If no protocol found, null is returned.
Public methodStatic memberGetQuery
Gets the query from URL.
Public methodStatic memberGetQueryValue(String, String)
Gets the query string value for specified key name.
Public methodStatic memberGetQueryValue(String, String, Boolean)
Gets the query string value for specified key name.
Public methodStatic memberGetSafeFileName(String, String)
Returns the safe equivalent to the given file name (with extension).
Public methodStatic memberGetSafeFileName(String, String, Boolean)
Returns the safe equivalent to the given file name.
Public methodStatic memberGetSafeUrlPart
Returns the safe part of URL. This method doesn't process complete URL it handles only part of URL.
Public methodStatic memberGetUrlExtension
Gets the extension for the given URL. Returns the extension with the dot, e.g. ".gif"
Public methodStatic memberGetUrlParameter
Returns value of query parameter from URL.
Public methodStatic memberGetVirtualPath
Converts the absolute path to the virtual.
Public methodStatic memberIsAbsoluteUrl
Returns true if provided URL is absolute and has http or https scheme. False otherwise.
Public methodStatic memberIsAnchor
Returns true for url's starting with hash (#) character.
Public methodStatic memberIsExcluded(String, String)
Checks if page with specified relative path is excluded from excluded paths.
Public methodStatic memberIsExcluded(String, String)
Checks if page with specified relative path is excluded from excluded paths.
Public methodStatic memberIsExcludedCustom
Checks if page with specified relative path is excluded from excluded paths.
Public methodStatic memberIsExcludedSystem
Checks if page with specified relative path is excluded from system paths.
Public methodStatic memberIsExcludedSystemEnum
Checks if page with specified relative path is excluded from system paths and returns the category of the excluded page.
Public methodStatic memberIsLocalUrl
Returns true if the given URL is local.
Public methodStatic memberIsRootDefaultDocumentRelativePath
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.
Public methodStatic memberIsSystemPath
Returns true if the given path is a system path. The path is expected to be lowercase and start with slash, e.g. "/cmsmodules/..."
Public methodStatic memberIsTldDomain
Returns true if domain is IP address or top level domain e.g localhost
Public methodStatic memberLimitURLReplacements
Limits multiple replacements, starting and trailing replacements from URL. Can be disabled by app key: CMSLimitUrlReplacement.
Public methodStatic memberLocalRedirect
Redirects (302 HTTP status code) the response using specified URL in case it is local, otherwise redirects to ApplicationPath
Public methodStatic memberMakeLinksAbsolute(String)
Returns the absolute representation of the HTML links (image paths ...).
Public methodMakeLinksAbsolute(String, String)
Returns the absolute representation of the HTML links (image paths ...).
Public methodStatic memberMergeQueryStrings
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.
Public methodStatic memberPropagateUrlParameters
Propagates the URL parameters from current URL to the given URL
Public methodStatic memberRedirect
Redirects the response using specified URL (302 HTTP status code).
Public methodStatic memberRedirectPermanent
Redirects the response using specified URL using permanent redirection using 301.
Public methodStatic memberRefreshCurrentPage
Refreshes the current page by doing a redirect to self
Public methodStatic memberRemoveAnchorFromUrl
Removes the anchor from the given url.
Public methodStatic memberRemoveApplicationPath
Removes the Application path from the URL.
Public methodStatic memberRemoveExtension
Removes the potential extension from the given path.
Public methodStatic memberRemoveFirstPart
Returns the string with first selector removed.
Public methodStatic memberRemoveParameterFromUrl
Removes specified parameters from the given URL.
Public methodStatic memberRemoveParametersFromUrl
Removes specified parameters from the given URL.
Public methodStatic memberRemovePort
Removes the port part from the domain name.
Public methodStatic memberRemovePortFromURL
Removes the port part from the whole URL.
Public methodStatic memberRemoveProtocol
Removes the protocol part from the URL.
Public methodStatic memberRemoveProtocolAndDomain
Removes the protocol and domain part from the URL.
Public methodStatic memberRemoveQuery
Removes the query from URL.
Public methodStatic memberRemoveTrailingSlashFromURL
Removes trailing slash from URL.
Public methodStatic memberRemoveUrlParameter
Remove parameter from query string.
Public methodStatic memberRemoveUrlParameters
Removes the given URL parameters
Public methodStatic memberRemoveWWW
Trim www if input text starts with it.
Public methodStatic memberResolveClientUrl
Resolves and combine client URL with base URL.
Public methodStatic memberResolveUrl
Resolves an application relative URL to the absolute form.
Public methodStatic memberResponseRedirect
Redirects the response using specified URL using standard redirection with Response.Redirect.
Public methodStatic memberSeeOther
Redirects the client to another URL using the GET method (303 H).
Public methodStatic memberTryCreateAbsoluteUrl
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.
Public methodStatic memberUnMapPath
Converts the physical file path to virtual path within the web application.
Public methodStatic memberUnResolveUrl
Un-resolves the given URL (replaces application path with ~).
Public methodStatic memberUpdateParameterInUrl
Update parameter in specified URL.
Public methodStatic memberUrlEncodeQueryString
URL encodes query string in given URL. Needs HttpContext.
Public methodStatic memberUseURLsWithTrailingSlash Obsolete.
Gets the settings for the URL trailing slash rules.
Top
See Also