[pmwiki-users] I need help with clean URLs
info at theburroughsproject.com
info at theburroughsproject.com
Mon Aug 14 23:27:09 CDT 2006
*** HAGAN SAID:
> Your wiki is not in fact in the document root,
> but in a pmwiki/ subdirectory. (That's better!)
Yes, I had it in my doc root at first, but then took your advice to move
it to it's own folder.
> The document root is one directory above the wiki's
> directory. This means you have something similar to
>
> http://www.pmwiki.org/wiki/Cookbook/CleanUrls#dir_above
>
> except the rewritebase is / .
>
> Try these:
>
> # Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
> RewriteEngine On
> # Define the rewrite base. It's not necessarily PmWiki's directory.
> RewriteBase /
> # Send requests without parameters to pmwiki.php.
> RewriteRule ^$ pmwiki/pmwiki.php [L]
> # Send requests for index.php to pmwiki.php.
> RewriteRule ^index\.php$ pmwiki/pmwiki.php [L]
> # Send requests to pmwiki.php, appending the query string part.
> RewriteRule ^([^/a-z].*) pmwiki/pmwiki.php?n=$1 [QSA,L]
>
> <?php if (!defined('PmWiki')) exit();
> ## Use "Clean URLs".
> $EnablePathInfo = 1;
> $ScriptUrl = "http://www.howtofreaks.com";
> ## more configuration settings...
This is precisely what I'm already using. The result, unfortunately, is
that the links point to clean URLs, but I get a 404 on them.
*** PICO SAID:
> My hunch is that you have "Pmwiki.php" (with a
> capital P) and that if you renamed the file to
> start with a lowercase "p" everything might start
> working.
Actually, my "pmwiki.php" file was all lowercase.
> So, on a hunch, I tried capitalizing the P in Pmwiki.php,
> like this
>
> http://www.howtofreaks.com/Pmwiki.php?n=Main.WikiSandbox
>
> and *it worked* I got your WikiSandBox page.
It's true that the URL:
http://www.howtofreaks.com/pmwiki.php?n=Main.WikiSandbox
does not work, while:
http://www.howtofreaks.com/Pmwiki.php?n=Main.WikiSandbox
does work, but actually *any* word beginning with a capitol letter will
work, for example:
http://www.howtofreaks.com/ScoobyDoo.php?n=Main.WikiSandbox
Here are some others that work:
http://www.howtofreaks.com/index.php?n=Main.WikiSandbox
http://www.howtofreaks.com/?n=Main.WikiSandbox
http://www.howtofreaks.com/?n=Main/WikiSandbox
I tried commenting out "$EnablePathInfo = 1;", and the links started
pointing to URLs like:
http://www.howtofreaks.com/?n=Main.WikiSandbox
just like you said.
*** TONY SAID:
> If you put pmwiki.php at $DOCROOT rather than $DOCROOT/pmwiki,
> shouldn't the .htaccess file be:
>
> # Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
> RewriteEngine On
> # Define the rewrite base.
> RewriteBase /
> # 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-z].*) pmwiki.php?n=$1 [QSA,L]
>
> as opposed to having "pmwiki/pmwiki.php" in the three RewriteRule
> lines?
If you have pmwiki.php in the root document folder (which I did at
first), then yes, but I have mine in a folder named "pmwiki". I've been
advised that it's not the best idea to have your pmwiki installation in
the root folder.
Thanks,
Phil
----
More information about the pmwiki-users
mailing list