NP_FancierURL2 provides search engine optimized URLs for Nucleus 3.22 and higher.
| General Plugin info | |
|---|---|
| Author: | Kai Greve |
| Current Version: | v0.6 |
| Download: | NP_FancierURL2_v06.zip |
| Code: | NP_FancierURL2_code and .htaccess_code |
| Demo: | - |
| Forum Thread: | here |
$CONF['Self']="http://yourdomain.com/yourdirectory";
before the last three lines
// include libs include($DIR_LIBS.'globalfunctions.php'); ?>
If you have already installed the default Fancy URL solution you have to move or remove some files first:
.htaccess archive archives blog category item member
The best way is to move them to a subdirectory like old.
After that you only need to follow step 1 to 4 (because you have already done step 5 and 6).
If you upgrade from version 0.1 to 0.2 it is important to uninstall the old version of the plugin in the Nucleus plugin manager and then upload and install the new version.
If you simply overide the old plugin you get some error messages and the new version can’t work. In this case you can uninstall and then install the plugin in the plugin manager to get it working.
Because NP_FancierURL2 uses the new events ParseURL and GenerateURL, from Nucleus 3.22 and higher it is not necessary to make changes to your skins to provide the new URLs.
This Skinvar <%FancierURL2%> also makes it possible to provide the Fancier URLs in your Feed templates like RSS and ATOM.
Here is an example for the RSS feed:
<item> <title><%title(xml)%></title> <link><%blogurl%><%FancierURL2%></link> <description><![CDATA[<%body%><%more%>]]></description> <category><%category%></category> <comments><%blogurl%><%FancierURL2%>#c</comments> <pubDate><%date(rfc822)%></pubDate> </item>
The Compatibility mode is usefull if your weblog has used the old style Fancier URLs from Nucleus and you have already links to these pages (e.g. /item/10). The only drawback is that you can’t use numbers as titles (e.g. if you write an article with the title “10” is resolved as item with the id 10 and not the real id).
New option in version 0.4:
Hint: For German is the setting ISO-8859-1 right.
After you installed FancierURL2, make sure go to the plugin menu and move the plugin’s order to the top (using “move up”). This plugin need to run before all other plugins in order to generate the URL correctly.
If you do not like the url to be http://www.domain.tld/item/item-name, you can change the item into other names.
Place this code in the config.php
// custom keywords to use in fancy URLs $CONF['ItemKey'] = 'article'; // default: $CONF['ItemKey'] = 'item'; $CONF['ArchiveKey'] = 'archive'; $CONF['ArchivesKey'] = 'archives'; $CONF['MemberKey'] = 'author'; // default: $CONF['MemberKey'] = 'member'; $CONF['BlogKey'] = 'blog'; $CONF['CategoryKey'] = 'department'; // default: $CONF['CategoryKey'] = 'category';
This will change the url structure to: http://www.domain.tld/article/item-name
Problem:
NucleusCMS returns error 404 for all links after FancyURL2 is installed.
Solution:
CONF[’Self’] in the index.php and config.php is correct.
Problem:
NucleusCMS returns error 500 for all links after FancyURL2 is installed.
Solution:
RewriteBase / on the first line.RewriteBase /
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?virtualpath=$1 [L,QSA]
RewriteRule ^(item/[^/]+)/.*$ /$1 [R=301,L]
</IfModule>
startpos is getting lost so that the inbuild pagaination of Nucleus CMS doesn’t work.