Cotonti / Open Source PHP Content Management FrameworkContent Management Framework

Forums / Cotonti / Development / Nice urls for plugins or modules

Trustmaster
#38262 2013-10-30 17:00

1. Create your custom datas/urltrans.dat based on plugins/urleditor/presets/handy.dat. Add these lines on top:

flowcharts	uname=*&fid=*	{$e}/{$uname}/{$fid}
flowcharts	uname=*			{$e}/{$uname}
flowcharts	fid=*			{$e}/{$fid}

2. Add these rules to your .htaccess:

RewriteRule ^flowcharts/([a-zA-Z][a-zA-Z0-9_-]*)/([0-9]+) index.php?e=flowcharts&uname=$1&fid=$2 [QSA,NC,NE,L]
RewriteRule ^flowcharts/([0-9]+) index.php?e=flowcharts&fid=$1 [QSA,NC,NE,L]
RewriteRule ^flowcharts/([a-zA-Z][a-zA-Z0-9_-]*) index.php?e=flowcharts&uname=$1 [QSA,NC,NE,L]
May the Source be with you!