[pmwiki-users] Clean URLs - how to make them even shorter?

Matt Simpson matthew at undertheoak.net
Sun Jan 30 11:31:05 CST 2005


Patrick, thank you!
One quick question... If I move to the root, as you show me below, will I
loose access to other paths branching off of root... e.g.
http://mydomain.net/mywonderfulphotos , http://mydomain.net/otherphpprogram/
, etc?

-- Matt Simpson -- matthew at undertheoak.net

----- Original Message ----- 
From: "Patrick R. Michaud" <pmichaud at pobox.com>
To: "Matt Simpson" <matthew at undertheoak.net>
Cc: <Pmwiki-users at pmichaud.com>
Sent: Sunday, January 30, 2005 12:23 PM
Subject: Re: [pmwiki-users] Clean URLs - how to make them even shorter?


> On Sun, Jan 30, 2005 at 12:01:42PM -0500, Matt Simpson wrote:
> > In the http://www.pmwiki.org/wiki/Cookbook/CleanUrls example,
> > how would one eliminate the /pmwiki/ or modify the /pmwiki/
> > within the URL to show something else?
> >
> > In my case, the example matches perfectly up to this point.
> > I create an .htaccess with this content...
> >
> > RewriteEngine on
> > RewriteRule ^([A-Z].*) /pmwiki/pmwiki.php?n=$1 [L,qsappend]
> > RewriteRule ^$ /pmwiki/pmwiki.php [L,qsappend]
>
> Just move your .htaccess file up one level to the directory that
> corresponds to your url "root".  Then urls like
>
>     http://undertheoak.net/Main/HomePage
>
> will be correctly forwarded to /pmwiki/pmwiki.php?n=Main/HomePage
>
> You'll still want to have variable settings in your config.php:
>
> ## for clean URL
>   $EnablePathInfo = 1;
>   $ScriptUrl = 'http://undertheoak.net';
>   $PubDirUrl = 'http://undertheoak.net/pmwiki/pub/';
>   $UploadUrlFmt = 'http://undertheoak.net/pmwiki/uploads';
>
> ----
>
> If you're wanting to preserve the 'wiki/Main/HomePage' syntax, you
> can either use aliases as before, or just rename the pmwiki/ subdirectory
> to wiki/ and update the RewriteRules and variables to use 'wiki' instead
> of 'pmwiki':
>
> ## wiki/.htaccess
> RewriteEngine on
> RewriteRule ^([A-Z].*) /wiki/pmwiki.php?n=$1 [L,qsappend]
> RewriteRule ^$ /wiki/pmwiki.php [L,qsappend]
>
> ## for clean URL
>   $EnablePathInfo = 1;
>   $ScriptUrl = 'http://undertheoak.net/wiki';
>   $PubDirUrl = 'http://undertheoak.net/wiki/pub/';
>   $UploadUrlFmt = 'http://undertheoak.net/wiki/uploads';
>
> Pm




More information about the pmwiki-users mailing list