Skip to content

fomenta/DnnUrlProvider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

DNN Extension URL Providers

Clone from: https://archive.codeplex.com/?p=dnnurlproviders

DNN Extension URL Providers are DNN Extensions that modify URL behaviour for specific DNN Extensions.

This is the open-source repository for Extension URL Providers to use with DNN 7.1 and later versions.

Extension URL providers are DNN plug-ins that extend the functionality of the DNN URLs to cover third-party URLs. These are URLs not defined directly by the DNN Core, created by third-party modules and other applications.

Each provider is installed through the DNN Host->Extensions page using the install wizard. Once installed, they can then be managed on a per-site basis through the Admin->Site Settings->Advanced Url Settings tab in DNN 7.1 and later versions.

DNN Social URL Provider

Simplified URLs for DNN Social Groups. The Social Url Provider will simplify the Social Groups Urls to replace the GroupId with a Url derived from the Social Group name.

The DNN Social Url Provider works with the standard DNN Social features for 7.1 and later versions.

This Extension for DNN modifies the way that the Social Group URLs work.

You can change Group Urls from this: http://example.com/Groups/groupid/10

to this:

http://example.com/your-social-group-name

It's simple! Just use these options: Hide Page Path from Group Urls = Checked (DNN Social Url Provider) Group Page = Select 'Social Groups Page' (DNN Social Url Provider)

Ensure that the Extension provider is enabled on the Admin->Site Settings->Advanced Url Settings tab.

Redirecting the Original Social Urls

If you get a request for a Url in the original format, it will be redirected back to the friendly version as you have configured.

DNN Url Redirect Provider

Redirect anything to anywhere in DNN

All-purpose generic redirects in DNN to redirect from any URL to any other URL. Works with DNN pages, legacy URLs, file URLs, etc.

The DNN Url Redirect Provider is an all-purpose redirect solution. It allows the listing of a set of URLs that must be redirected, and where they should be redirected to. This can be used for DNN pages, files, legacy URLs from old sites - anything at all. There is no requirement to tie a redirect to a specific DNN page.

The Url Redirect Provider is essentially a list of to/from Urls to be redirected. These Urls can be anything- they aren't restricted to DNN pages or pages within third party Urls. They can be .pdf files, .jpg files, .aspx Urls - from whatever to wherever. This provider has been built to give a one-size-fits-all solution to all those sticky redirect issues.

Instructions for Use

  1. Only works with DNN 7.1 or later - no other versions will work.
  2. Install this provider via host->extensions
  3. Navigate to admin->site settings -> Advanced URL Settings, and ensure that the provider is enbled for the specific portal.
  4. Go to your sql server and open the dnn_urp_Redirect table directly for editing. This is the table that contains all the redirects.
  5. The columns in the redirect table are as follows: RedirectId : guid, auto generated for new rows *PortalId : for portal redirect applies to *RedirectOrder : sequence number for returning rules in order *HttpAlias : portal alias that redirect applies to (ie example.com if redirecting to/from example.com) *RedirectUrl : Url to be redirected. Either absolute or relative (absoltue : http://examle.com/to-be-redirected) Relative is without http:// and portal alias so (/to-be-redirected) *MatchType : Relative or Absolute (text) to match RedirectUrl value *KeepQueryString : if true, any query string on the requested url is carried over to the redirected url. If false, querystring is discarded *DestTabPath : if redirecting to a DNN page, tab Path (ie //AboutUs) Null if redirecting to an absolute Url, or if DestTabId is supplied *DestTabId : TabId for page if redirecting to a DNN page (alternate way of specifiying page, see DestTabPath. Null if using either DestTabPath OR if using Absolute Url *DestUrl : When redirecting to Absoltue Url, the Url to redirect to (ie example.com/this-is-the-new-url) OR if redirecting to Tab, the path to append to the end (ie /entryId/12/this-is-a-post). NOTE: if using 'Url' as DestType and no http:// found, will add on the requested scheme and the HttpAlias as specified. *DestType : Either 'Tab' for redirecting to a tab, or 'Url' if redirecting to an absolute Url *IsRegex : if true, the RedirectUrl and DestUrl values can be a regex pattern / replace pattern respectively. False if not using regex patterns

Here's an example of a table row for redirecting a simple to/from Url: PortalId : 0 RedirectOrder : 10 RedirectUrl : /some-other-url.aspx MatchType : Relative KeepQueryString : false DestTabPath : NULL DestTabId : NULL DestUrl : /some-new-url.aspx DestType: Url IsRegex : False

This redirects http://example.com/some-other-url.aspx to http://example.com/some-new-url.aspx

See SQL to insert a new redirect record for more examples of actual SQL to insert redirect records.

  1. Restart the app or use the 'Clear Cache' option in DNN (rules are cached, so a restart currently needed to flush the cache, this can be improved later with a 'refresh' button)
  2. Test the URL redirects out with a tool like Fiddler to ensure they are working as expected.

This particular project can be greatly improved with a UI for entering the redirect rules and button for flushing and rebuilding the cache. Any project volunteers are greatly welcome - please contact via the Discussions.

SQL to insert a new redirect record

This is the general format for inserting redirect records (through the host->SQL page)

{"INSERT INTO {databaseOwner}{objectQualifier}urp_Redirect (PortalId ,RedirectOrder ,HttpAlias ,RedirectUrl ,MatchType ,KeepQueryString ,DestTabPath ,DestTabId ,DestUrl ,DestType ,IsRegex) VALUES (0 ,1 ,null ,'/test-url-1' ,'relative' ,1 ,null ,null ,'http://example.com/tested/redirected' ,'url' ,0)

INSERT INTO {databaseOwner}{objectQualifier}urp_Redirect (PortalId ,RedirectOrder ,HttpAlias ,RedirectUrl ,MatchType ,KeepQueryString ,DestTabPath ,DestTabId ,DestUrl ,DestType ,IsRegex) VALUES (0 ,2 ,null ,'/test-url-2' ,'relative' ,1 ,null ,55 ,'/tested/redirected' ,'tab' ,0) "}

Syntax Example 1 Will redirect from your-site/test-url-1 to example.com/tested/redirected

Syntax Example 2 Will redirect from your-site/test-url-2 to your-site/home/tested/redirected (assuming tabid 55 = the home page on your dnn install).

In both cases, it is assumed the 'your-site' is a portal alias for portal Id 0 in your DNN install.

Note: you must clear the cache or restart the application after inserting the records.

About

DNN Extension Url Providers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published