[pmwiki-users] Having difficult with .htaccess files

Andrew Long aolong62 at adelphia.net
Thu Jun 29 15:43:22 CDT 2006


Thursday, June 29, 2006, 9:53:00 AM, you wrote:

> On 6/29/06, Joachim Durchholz <jo at durchholz.org> wrote:
>> phenotype schrieb:
>> > # Use mod_rewrite to enable "Clean URLs" for a PmWiki installation.
>> > RewriteEngine On
>> > # Define the rewrite base.
>> > RewriteBase /wiki
>> > # 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]
>> >
>> > The /wiki directory is in my site root (/var/www/html/), and I want
>> > the wiki to appear at the /wiki directory, as you can tell.
>>
>> Ah, the standard recipe doesn't cover that.

> Are you sure?  The reason I ask is because I think I have CleanUrls
> working very similarly for several wikis in a farm setup and I recall
> using the standard recipe when I configured them.  I'll check next
> time I get the chance.

> Maybe a better question is:  What specifically is missing from the
> recipe that would cover that?

> Hagan

I am very new to this, but I noticed one thing that may apply here;
I see the rewrite rules in .htaccess, but I see no conditions.

Here is my .htaccess, which works to perform rewrite:
(subdomain replaced by "sub", domain replaced by "example")

RewriteEngine on

##Following 3 lines original to install
RewriteCond %{HTTP_HOST} ^.sub.example.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.sub.example.com$
RewriteRule ^(.*)$ http://www.example.com/sub [R=301,L]

## These lines added to clean urls
RewriteBase /sub
RewriteRule ^$           index.php  [L]
RewriteRule ^index.php$  index.php  [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)         index.php?n=$1  [QSA,L]


Regards-
Andrew Long





More information about the pmwiki-users mailing list