[pmwiki-users] Clean URLs Revisited

Sivakatirswami katir at hindu.org
Wed Oct 5 23:59:06 CDT 2005


OK we have

1) a farm installation of pmwiki here:

/pmwiki/pmwiki.php

2) a field here

/web_seva/wiki

where the index.html file contains <?php include('../../pmwiki/ 
pmwiki.php'); ?>

everything works fine... now, trying to implement clear urls... in  
the field:

/web_seva/wiki/local/config.php

we set, as per cookbook guide:

$ScriptUrl = 'http://www.himalayanacademy.com/web_seva/wiki/index.php';
$EnablePathInfo = 1;

Ok still, so far so good, no problems: but we are getting even  
without any .htaccess mod_rewrite directives:

http://www.himalayanacademy.com/web_seva/wiki/index.php/HPI/ 
HinduPressInternational

now, how to eliminate the "index.php" in the URL string? OK, next  
try .htaccess mod_rewrite

create file in the field directory, at the top:

/web_seva/wiki/.htaccess:

Options +FollowSymLinks
   RewriteEngine on

   # Redirect browsers that use an empty URL
   # to the default URL.
   RewriteRule ^/?$ http://www.himalayanacademy.com/web_seva/wiki/  
[R=permanent,QSA,L]

   # Map URLs that start with anything but a lower-case letter to  
pmwiki.php.
   # The remaining URLs are left to the default map-to-filesystem  
routine of Apache.
   RewriteRule ^([^/a-z].*) index.php?n=$1 [QSA,L]

An attempt to enter the home page generates an error from Apache:
"Redirection limit for this URL exceeded. Unable to load the  
requested page. This may be caused by cookies that are  
blocked" (which they are not in my browser prefs)

??  But... if you enter a full URL:

http://www.himalayanacademy.com/web_seva/wiki/index.php/HPI/ 
HinduPressInternational

it goes right thru just fine, but the "index.php" part of the string  
is not eliminated..

Before I start on a mango picking expedition to fix this, Hoping for  
input on the best tree  to start with.

Thanks!

Sivakatirswami









More information about the pmwiki-users mailing list