[pmwiki-users] The return of CleanUrls

H. Fox haganfox at users.sourceforge.net
Mon Feb 27 13:42:07 CST 2006


On 2/27/06, Dominique Faure <dominique.faure at gmail.com> wrote:
> Hi,
>
> Digging around I found an other solution to the
> http://www.pmwiki.org/wiki/Cookbook/CleanUrls problem. In the mood of
> the "Index File" alternative, this doesn't require mod_rewrite neither
> mod_alias configuration:
>
> Create a file name "wiki" and containing enough code to bootstrap your
> wiki as in:
>
>   <?php chdir('pmwiki'); include_once('pmwiki.php');
>
> and provide following directives into a @@.htaccess@@ file in the same
> directory:
>
>   <FilesMatch "^wiki$">
>     ForceType application/x-httpd-php
>   <FilesMatch>
>
> making the "wiki" file being interpreted by Apache as a regular php script.
> The local/config.php should be edited to set the differents pathes accordingly.
>
> This trick came from the french site:
> http://web.developpez.com/tutoriel/apache/urlrewriting/#L4
>
> I only roughly tested it but seems to work nicely, and certainly need
> more work to be integrated into the cookbook recipe.

When I rewrote the CleanUrls page I was aware of this method.  It's
not included on the recipe's page because, as far as I can tell, it
doesn't offer anything new.  The same thing can be accomplished more
simply (and reliably) by installing your wiki in a directory named
wiki/ and using an index.php wrapper script.

You can also accomplish almost exactly the same thing by creating a
directory and placing an index file in it.

I added the following to the recipe, along with an example, so people
will know they can put a wrapper script anywhere.

   You can put an index file in any directory, including the
   document root, as long as the path in the index file points
   to your wiki's directory and the $ScriptUrl in config.php
   matches.

If every possible way of having shorter URLs is included on the
CleanUrls page it will make an already-confusing subject more
confusing.  That said, if there's some reason the ForceType solution
is better than using an index file, it should be included.

Hagan




More information about the pmwiki-users mailing list