[pmwiki-users] Clean URLs Revisited

Sivakatirswami katir at hindu.org
Fri Oct 7 21:06:48 CDT 2005


Wayne, Thank you!

It is working...  the error message was due to a fundamental blooper  
on my part... I was not declaring the homePage as in:

   RewriteRule ^/?$ http://www.himalayanacademy.com/web_seva/wiki/  
[R=permanent,QSA,L]

By simply adding "index.php" :

   RewriteRule ^/?$ http://www.himalayanacademy.com/web_seva/wiki/ 
index.php [R=permanent,QSA,L]

it worked..

and then, removing "index.php" from the scriptUrl, in turn cause the  
clean URL's also not to show any "index.php" in the url string... But  
that's what the cookbook says...I just didn't pay close attention  
(working too late!)

ScriptUrl = "http://www.himalayanacademy.com/web_seva/wiki";

Rewrite base was not needed.

i.e in fact the cookbook recipe, if followed carefully (exactly!)...  
works out of the box.  the only thing for a newbie that might  
help...  where is says:

" RewriteRule ^/?$ http://some.domain/path/to/wiki/dir/Main/HomePage  
[R=permanent,QSA,L]"

the "HomePage" has no extension on it in the example... i.e. in my  
case I needed "index.php" to be where "/HomePage" is in the  
example... for some of us... if we don't see the dot extension, we  
assume its declaring a directory without a slash...

I'm a bit timid about actually putting in my two cents on the actual  
cookbook page as I am not an expert... but a  one line explanation  
there about what "HomePage" really means in the rewrite rule might  
save others in the future.

Sivakatirswami



On Oct 06, 2005, at 4:54 AM, Waylan Limberg wrote:

>> 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)
>>
>>
>
> I'm not 100% sure, but I think this is a result of not setting the
> RewriteBase. Whenever you define rewrite rules in a .htaccess file
> that is not at the server root you should define RewriteBase. This
> basicly tells Apache to treat said directory as the root dir  for the
> following rules. Before any rewrite rules, but after "RewriteEngine
> on" add the line:
>
> RewriteBase /local/path/to/web_seva/wiki/
>
>
>> ??  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..
>>
>>
>
> That's correct, and it should. Conversely, if you enter
> http://www.himalayanacademy.com/web_seva/wiki/HPI/ 
> HinduPressInternational
> that should work as well. Enabling the clean URLs does not redirect
> URLs of the old format to the new. It just directs the URLs of the new
> format to the old (transparently to the user).
>
> However, if PmWiki is still generating the URLs in the old format then
> that is another matter. Mod_Rewrite only tells Apache which URLs to
> direct to PmWiki (or elsewhere), but otherwise has no effect on how
> PmWiki acts. Therefore you need to make the following change in
> config.php:
>
> ScriptUrl = "http://www.himalayanacademy.com/web_seva/wiki";
>
> Notice, we dropped the "/index.php" part of the URL.
>
>
> --
> ----
> Waylan Limberg
>





More information about the pmwiki-users mailing list