[pmwiki-users] protection against reading directories with truncated path

Stephan Schildberg schildberg at scoid.de
Wed Sep 14 10:31:42 CDT 2005


>>This is what I do now, inserting an index.htm that
>>deviate to the next higher level of a PmWiki created page.
>>    
>>

I see my misdesign of my website structure ( if name it: Sample. 
AnotherSample) . You have this fallback mechanism, if you name it not 
after that scheme toplevel pages  won't display and you have to work it 
out manually.  I just didn't care. :-(

We couldn't find a page called "Sample". You can:

    * Create Sample.Sample?
    * Create Sample.HomePage?
    * Create Main.Sample

>  
>
>>The next question is, how I can keep my visitors from watching pages 
>>which do not exist, aka what normally would be a 404 -error page.
>>Here obviously my method (index.htm - deviation) above does not apply.
>>    
>>
>
>You can actually have PmWiki return a 404 for non-existent pages:
>
>    if ($action == 'browse' && $pagename && !PageExists($pagename)) {
>      header("HTTP/1.0 404 Not Found");
>      print "Page Not Found\n";
>      exit();
>    }
>  
>
This works fine (thank you Patrick!), how can I link to a custom error 
page, instead of the print command?
The most elegant way of course would be a link to another pmwiki page 
for me.



regards, Stephan.




More information about the pmwiki-users mailing list