Tab Redirect Url improved hinting/placeholder
See original GitHub issueDescription of Problem
I would like to request for comment/consideration a small improvement to the Page Settings (tab settings) interface to give better help/information to admin users.
I often see an issue where admin users will attempt to setup a page redirect and encounter issues because they do not realize that the Redirect URL expected is a full path complete URL vs being able to accept a local path / incomplete URL. Because of the error messages seen, it can be hard for them to troubleshoot if they don’t fully understand what has happened in their page redirect.
Take the example of an admin who attempts to set the Page Setings (tab settings) URL Redirect for a page originally called “Dictionary”
They want to redirect from //Dictionary to //Glossary so in the URL field, they enter //Glossary and are expecting the redirect to happen as https://www.domainname.com/Glossary they often enter this type of value into the HTML module when working with anchor links and among other reasons have learned to enter //Glossary so that it loads correctly whether https or http for their domain name.
however, what is saved in the database and displays in the Page Settings the next time it is loaded is a value of http:////Glossary
This then performs a redirect loading either a browser’s error message of “cannot locate domain”, OR in older DNN versions, an error message like this
Exception:
Invalid URI: The hostname could not be parsed.
Stack Trace:
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) at System.Uri.CreateUri(Uri baseUri, String relativeUri, Boolean dontEscape) at System.Uri..ctor(Uri baseUri, String relativeUri) at System.Web.HttpResponse.ConvertToFullyQualifiedRedirectUrlIfRequired(String url) at System.Web.HttpResponse.Redirect(String url, Boolean endResponse, Boolean permanent) at System.Web.HttpResponse.RedirectPermanent(String url) at DotNetNuke.Entities.Urls.AdvancedUrlRewriter.CheckForTabExternalForwardOrRedirect(HttpContext context, UrlAction& result, HttpResponse response, FriendlyUrlSettings settings, Guid parentTraceId) at DotNetNuke.Entities.Urls.AdvancedUrlRewriter.ProcessRequest(HttpContext context, Uri requestUri, Boolean useFriendlyUrls, UrlAction result, FriendlyUrlSettings settings, Boolean allowSettingsChange, Guid parentTraceId)
Administrators
You can see this exception because the customErrors attribute in the web.config is set to 'off'. Change this value to 'on' or 'RemoteOnly' to show Error Handling
The error handling would have shown this page : Default.aspx?TabId=412
This can be difficult for an admin to troubleshoot if they do not understand what has happened with the redriect attempt. The information within the DNN Event Log is perfect and gives good information regarding the issue, but they may not see the error.
Proposed Solution Option 1
I would like to propose that we improve the help text and the hinting/placeholder in the field to give better information to the user regarding what is expected for the field
Suggested Help Text: Redirect to a URL Address. Please enter a full-path URL complete with http/https. Suggested Field Hinting: Enter complete path URL
Affected version
- 9.3.2
- 9.3.1
- 9.2.2
- 9.2.1
- 9.2
- 9.1.1
- 9.1
- 9.0
- 8.x
- 7.x
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (7 by maintainers)
Top GitHub Comments
That being said should it be instead possible to be able to redirect to a relative URL. I saw another issue or question somewhere where the user wanted to redirect a page to an anchor on another page, so he entered /ThePage#TheAnchor
Should it instead be modified in the code to not automatically add http:// ?
Whohoo! Go David Go!