[pmwiki-users] CamelCaseToLowerCase in Router.php with Apache mod-rewrite module

Benoit St-Pierre benbonben at gmail.com
Tue May 11 15:28:47 CDT 2010


Carlos,

Here are the answers to your question:

> What is your pmwiki version ?

I don't know.  I installed it last December.  How can we tell?

> Can we look your wiki site ?

Of course: www.benoitstpierre.info/scid

> Can we look at your .htaccess file?

Here it is (I think it's pretty standard):

# Use mod_rewrite to enable "Clean URLs" for a PmWiki installation
# see http://www.pmwiki.org/wiki/Cookbook/CleanUrls, method 1.
RewriteEngine On
# Define the rewrite base.
RewriteBase /scid/
# Send requests without parameters to pmwiki.php.
RewriteRule ^$ pmwiki.php  [L]
# Send requests for index.php to pmwiki.php.
RewriteRule ^index\.php$ pmwiki.php  [L]
# Send requests to pmwiki.php, appending the query string part.
RewriteRule ^([A-Z0-9\xa0-\xff].*)$ pmwiki.php?n=$1  [QSA,L]

# Don't rewrite requests for any files, directories, or symbolic
# links (shortcuts) that exist on the filesystem.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

> What else have you included in config.php ?

## Skin

$Skin = 'equilibrium';
$SkinColor = 'dark-orange';

## Buttons

$EnableGUIButtons = 0;

## Creole - http://www.wikicreole.org/ - A real study! I really like it!

include_once("scripts/creole.php");

## Pagetoc ?

include_once("$FarmD/cookbook/pagetoc.php");

## Preformatted lines - 1 space

$EnableWSPre = 1;

## Wiki Words -- no

$SpaceWikiWords = 0;
$EnableWikiWords = 0;

$MakePageNamePatterns = array(
    "/'/" => '',						# strip single-quotes
    "/[^[:alnum:]_-\\s]+/" => '',				# convert non-alnums to spaces
    "/([\\w]+)/e" => "strtolower('$1')",			# make all lowercase
    "/\\s+/" => '_'						# convert spaces to underscores
);
$GroupPattern = '[\\w]*(?:-\\w+)*';
$NamePattern = '[\\w]*(?:-\\w+)*';

I think that is all, but I can send you my file if you need so.

NB.  I disabled $MakePageNamePatterns for people to have a look around.

> Just tested it and for me it is not a great idea anymore,  maybe
> others can help you better than me .

What do you (or anyone) suggest?

> why is it so popular? SEO?

My own guess is that lowercase-and-hypens are just more readable, so
more usable.  That's just a guess, based on my personal experience.  I
also admit that I never was very fond of WikiCamelCase.  It's a neat
trick, but only a trick.  Blogs win, so wiki users must adapt.  ;-)ùz



More information about the pmwiki-users mailing list