rewrites for tikiwiki

Discuss practical ways rearrange URLs using mod_rewrite.

rewrites for tikiwiki

Postby stox » Tue Mar 03, 2009 12:00 am

Tikiwiki by default can have several mod rewrites activated. These work well for the most part but I need a couple more. I need one rewrite that will take mysite.com/tiki-index.php and make it just mysite.com or mysite.com/ This can only be for the homepage however since tiki uses dynamically generate content using tiki-index.php

^^Figured out the above, just used
DirectoryIndex tiki-index.php

The second rewrite I need is a rewrite that can take an & symbol and change it to a ?. This can only be for the first & in the address though. Example would be /HomePage&bl=n&saved_msg=y changed to /HomePage?bl=n&saved_msg=y
stox
 
Posts: 3
Joined: Mon Mar 02, 2009 11:53 pm

Postby richardk » Tue Mar 03, 2009 3:13 am

The second rewrite I need is a rewrite that can take an & symbol and change it to a ?. This can only be for the first & in the address though. Example would be /HomePage&bl=n&saved_msg=y changed to /HomePage?bl=n&saved_msg=y

Try
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^([^&]*)&(.*)$ /$1?$2 [R=301,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby stox » Tue Mar 03, 2009 8:10 am

That worked perfectly. Thank you.
stox
 
Posts: 3
Joined: Mon Mar 02, 2009 11:53 pm


Return to Friendly URLs with Mod_Rewrite

Who is online

Users browsing this forum: No registered users and 21 guests

cron