[pmwiki-users] Putting ".html" extensions onto pages

Patrick R. Michaud pmichaud at pobox.com
Wed Mar 1 10:46:01 CST 2006


On Wed, Mar 01, 2006 at 11:03:01AM -0500, Neil Herber wrote:
> At 2006-03-01  09:51 AM -0600, Patrick R. Michaud is rumored to have said:
> >> The only thing I can see is some confusion:
> >>
> >> http://www.pmwiki.org/wiki/Main.html --> redirects to Main/Main or
> >> Main/Html?
> >
> >At the moment it wouldn't redirect at all--it would simply serve
> >up the Main.Html page since this is a valid page request.
> 
> I must be thick today .... What happens for non-existent pages? 

For non-existent pages, PmWiki would handle 
http://www.pmwiki.org/wiki/Main.html in the same manner as it would 
for http://www.pmwiki.org/wiki/Main.NonExistentPage --
that is, it would produce a "page not found" display and possibly
invite the visitor to create the non-existent page.

> For 
> example if I put a [newpage] link in the edit box, what does the URL 
> end up looking like? 

Assuming you're editing a page in group "Main", you'd get:

    http://www.pmwiki.org/wiki/Main/NewPage.html?action=edit

> What if I do something perverse like linking to 
> the page about [HTML] ? 

    http://www.pmwiki.org/wiki/Main/HTML.html?action=edit

> Or [Markups.HTML]?

    http://www.pmwiki.org/wiki/Markups/HTML.html?action=edit

I should note that I don't expect the adding of ".html" to urls
to be a common setting at all, nor would it be something that
would ever be visible to the average visitor.  I'm simply asking
if we should include the capability for sites that do want some
help in creating static copies of a site.  

I'm thinking that an administrator wanting to enable this 
would likely do (assuming HTTrack):

    if (preg_match('/HTTrack/', $_SERVER['HTTP_USER_AGENT')) {
      # code to enable ".html" extensions on pages here
    }

So, regular visitors to a site see the same .html-less urls we've
always seen, while web scrapers can get the pages with the .html
extension added (and links adjusted as appropriate).  Or, if a
human visitor needs to see the links with .html extensions for 
some reason, they simply set a cookie, skin, or other configuration
option that turns on the extensions for that visitor.

Pm




More information about the pmwiki-users mailing list