Plugin: LMRedirectToItem

Set up redirects for items when migrating to a different URL scheme for a Nucleus blog.

General plugin info
Author:Leo
Current version:1.1.0
Download:NP_LMRedirectToItem_v110.zip
Support: Plugin comments or forum thread
Compability:Nucleus CMS 3.60

Plugin overview

The NP_LMRedirectToItem plugin was primarily made as a help when migrating to a different URL scheme for a Nucleus blog.

It can set up redirects for all item URLs in the old URL scheme. Then you can migrate the blog to a different URL scheme and all old item URLs can still be used to access the items. The plugin uses permanent redirects by default so search engines should be updated with the new item URLs.

Other uses for this plugin is to set up fixed URLs where you can change the item the URL will show. Ideal where you want to have an URL that shows the newest item of a certain kind. You can also use it to make a short URL for an item. To use permanent or temporary redirects can be configured for each redirect.

Installation

The plugin is installed as a normal plugin. It will need the same .htaccess change that fancierURL plugins uses to be able to do redirects:

<IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^(.*)$ index.php?virtualpath=$1 [L,QSA]
</IfModule>

The plugin has one configurable option: "Delete NP_LMRedirectToItem data on uninstall?". This option lets you decide if you want to delete the NP_LMRedirectToItem data when you uninstall the plugin.

Upgrade

  • Take a backup of the current plugin files. You will need these if you want to rollback to the previous version after the upgrade.
  • Take a backup of the database used for you Nucleus installation.
  • Replace the old plugin files with the new ones. Do not uninstall the plugin.
  • If a plugin data upgrade is needed, will an upgrade plugin data option be available on the NP_LMRedirectToItem plugin admin page. Choose this option to upgrade the plugin data.
  • After the plugin data upgrade has been performed may a rollback option and a commit option be available on the NP_LMRedirectToItem plugin admin page. Not all upgrades support the rollback and commit option.
  • If you are not pleased with the new version of the plugin you may use the rollback option to rollback the plugin data upgrade. After the rollback of the plugin data upgrade you have to replace the new plugin files with the old plugin files.
  • If you are pleased with the new version of the plugin you should use the commit option to commit the plugin data upgrade. After the commit of the plugin data upgrade will any rollback and commit options disappear.

Usage

The redirects are administered from the plugin admin page which can be accessed from either the quick menu in the admin area, or from the admin link for the plugin in the plugin list. Only the blog super administrator can access the plugin admin page.

In the admin area for the LMRedirectToItem plugin you can do the following operations:

  • Edit or delete existing redirects.
  • Create new redirect.
  • Create redirects for all items in all blogs.
  • Delete all redirects.
  • See the plugin help page.

When you register a redirect should the redirect from field not include domain, only the absolute path (from the document root) including any query string. No wildcards are allowed. Examples: "/index.php?itemid=1" or "/some/path". If you have Nucleus installed in a sub directory on the web server, must the redirect from always include the sub directory. Examples: "/nuclusdir/index.php?itemid=1" or "/nuclusdir/some/path".

If the redirect from url is the same as the url of the item redirecting to, will the redirect be ignored. The plugin does not check for circle redirect loops.

To set up a redirect you have to have the item id for the item you want to redirect to. This item id can be obtained by checking the edit item URL in the admin area. Example: http://example.com/nucleus/index.php?action=itemedit&itemid=1. For this item is the item id is 1. After you have created the redirect you can check if the redirect is to the correct item as the redirect to item id column in the plugin admin area has an item link.

The plugin can use permanent or temporary redirects. This can be set up for each redirect. If there is a chance a redirect may be changed to a different item is it best to set it up as a temporary redirect.

Using the plugin to redirect from the old URL scheme item links when changing the URL scheme is quite easy:

  • Install the LMRedirectToItem plugin.
  • Execute the "Create redirects for all items" function on the plugin admin page. It's important this is done while the old URL scheme is active.
  • Install and setup your new URL scheme plugin.

Support and Bug reports

For additional support and/or bug reports please use the Nucleus forum plugin announce thread or the plugin page comment section.

Compability

This version of the NP_LMRedirectToItem is tested against version 3.64 of Nucleus CMS. Minimum version of Nucleus CMS needed for using the plugin is 3.50.

Version History

  • v1.0.0 2011-06-27: by Leo (http://www.slightlysome.net)
    • Initial version.
  • v1.1.0 2011-08-06: by Leo (http://www.slightlysome.net)
    • Possibility to set if a redirect should use temporary or permanent redirects.
    • Implemented my suggested plugin data upgrade handling. The plugin does the upgrade handling by itself, and is not dependent of any core changes or other handling plugins.

Download

Download NP_LMRedirectToItem v1.1.0.


Add Comment

Spam and off topic comments will be deleted.

Allowed BBCode:[b] [i] [u] [s] [color=] [size=] [quote] [code] [email] [url]