[pmwiki-users] forcing SSL with a WikiFarm?

Chris Cox ccox at airmail.net
Mon May 7 14:16:05 CDT 2007


Alan Hoyle wrote:
> I'm running pmwiki-2.2.0-beta35 and using .htaccess files for
> authentication.  I'm trying to force a WikiFarm sub-wiki to use SSL.
> 
> I can get most of the stuff to work by overwriting the $ScriptURL
> ="https://<MYSERVER/PATH>" but I don't want to change the "pub" part
> of the URL as that directory doesn't exist.
> 
> The problem that I'm having is that uploads (images, attachments, etc)
> aren't getting the https:// part of the URL.
> 
> What's going on?  Are the .../uploads/Main/etc. urls derived from the
> $PubDirUrl?  Is there something else I should be overriding?
> 

Personally, I've found it easier (if using Apache for example)
to use a modrewrite rule.  I use this on my sites using
UserAuth (not the builtin AuthUser) to make sure it goes
https when the login page is used.

So... once your website is setup to serve pages via
ssl (could be the whole site), just do a modrewrite.

For example for UserAuth my .htaccess has:

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^pmwiki/pmwiki.php/Main/LoginPage$
https://%{SERVER_NAME}/pmwiki/pmwiki.php/Main/LoginPage [R,L]

Obviously this is for $EnablePathInfo = 1
That second rule is on one line (one rule)




More information about the pmwiki-users mailing list