<div dir="ltr"><div dir="ltr">Petko -<div>thanks very much - </div><div><br></div><div>there were no definitions of $PubDirUrl or $FarmPubDirUr in my config.php, so I defined them as you suggested.</div><div><br></div><div>I also needed to define $ScriptUrl (which for some reason doesn't point to the scripts folder - so I took a wrong turn there!)</div><div><br></div><div>Everything seems to work fine now. </div><div><br></div><div>Thanks again</div><div>James</div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, May 24, 2020 at 12:17 PM Petko Yotov <<a href="mailto:5ko@5ko.fr">5ko@5ko.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">It is likely that config.php has defined some variables to the old <br>
domain.<br>
<br>
The easiest fix may be in config.php to simply comment out or delete the <br>
definitions of $PubDirUrl and/or $FarmPubDirUrl if they exist.<br>
<br>
If this is not enough, then PmWiki is incapable to detect the correct <br>
URLs, and you can set them to the correct domain:<br>
<br>
  $FarmPubDirUrl = "<a href="https://www.example.org/pmwiki/pub" rel="noreferrer" target="_blank">https://www.example.org/pmwiki/pub</a>";<br>
  $PubDirUrl = "<a href="https://www.example.org/field/pub" rel="noreferrer" target="_blank">https://www.example.org/field/pub</a>";<br>
<br>
The values are the URL path reachable via browser to the "pub" <br>
directory, under which there will be "skins/yourskinname/skin.css". You <br>
can usually see this path in the html source of any page on the new <br>
domain in a <link...> tag:<br>
<br>
   <link rel='stylesheet' href='__URL_HERE__/skins/yourskinname/skin.css' <br>
/><br>
<br>
and you need to take the part preceding "/skins/yourskinname/...". (And <br>
use the new domain name.)<br>
<br>
You shouldn't need to manually set $SkinDirUrl.<br>
<br>
<br>
If you have incoming visitors to <a href="http://oldwww.etc" rel="noreferrer" target="_blank">http://oldwww.etc</a> (not https: which <br>
will likely fail) you can redirect them to the new domain.<br>
<br>
Best is to redirect from the old to the new via .htaccess at the <br>
document root. I use something like this on a few domains:<br>
<br>
   RewriteEngine On<br>
<br>
   # Redirect <a href="http://oldwww.example.org" rel="noreferrer" target="_blank">oldwww.example.org</a> to <a href="http://www.example.org" rel="noreferrer" target="_blank">www.example.org</a><br>
   # Also redirect http to https<br>
   RewriteCond %{HTTPS} off [OR]<br>
   RewriteCond %{HTTP_HOST} ^oldwww\.example\.org [NC]<br>
   RewriteRule (.*) <a href="https://www.example.org" rel="noreferrer" target="_blank">https://www.example.org</a>%{REQUEST_URI} [R=303,L]<br>
<br>
<br>
With Apache 2.4 or newer you may be able to use (note the quotes):<br>
<br>
   <If "%{HTTP_HOST} == '<a href="http://oldwww.example.com" rel="noreferrer" target="_blank">oldwww.example.com</a>'"><br>
     Redirect permanent "/" "<a href="https://www.example.com/" rel="noreferrer" target="_blank">https://www.example.com/</a>"<br>
   </If><br>
<br>
Both these depend on what is allowed in .htaccess on the server.<br>
<br>
<br>
Within PmWiki, you can also redirect, early in config.php:<br>
<br>
   # this will redirect <a href="http://oldwww.example.org" rel="noreferrer" target="_blank">oldwww.example.org</a>,<br>
   #   <a href="http://example.org" rel="noreferrer" target="_blank">example.org</a> or other to <a href="http://www.example.org" rel="noreferrer" target="_blank">www.example.org</a><br>
   if($_SERVER['HTTP_HOST'] != '<a href="http://www.example.org" rel="noreferrer" target="_blank">www.example.org</a>' || $UrlScheme != <br>
'https') {<br>
     Redirect($pagename, <br>
"<a href="https://www.example.org" rel="noreferrer" target="_blank">https://www.example.org</a>".$_SERVER['REQUEST_URI']);<br>
     exit;<br>
   }<br>
<br>
<br>
<br>
Petko<br>
<br>
-- <br>
If you upgrade :  <a href="http://www.pmwiki.org/Upgrades" rel="noreferrer" target="_blank">http://www.pmwiki.org/Upgrades</a><br>
<br>
<br>
On 24/05/2020 12:06, James M wrote:<br>
> I have a strange set up at work - our web pages (in particular my <br>
> pmwiki)<br>
> is served by 2 web servers (apache I believe), one called www.etc and <br>
> the<br>
> other oldwww.etc.  I don't have access to the servers, and the IT <br>
> people<br>
> who do are unresponsive (presumably, to give them the benefit of the <br>
> doubt,<br>
> the coronavirus issues are producing a lot of extra work).<br>
> <br>
> Anyway, the www.etc works fine.  But the oldwww.etc has an expired<br>
> certificate and my browsers don't load the pages when directed to that<br>
> server.  For some reason, the servers are set up so that $SkinDirUrl <br>
> become<br>
> oldwww.etc/my-wiki-address rather than www.etc/my-wiki-address.<br>
> <br>
> The short question is, how can I tell $SkinDirUrl explicitly to use<br>
> www.etc?  Perhaps also $ScriptUrl?  I'm not sure exactly which <br>
> variables I<br>
> need to set.  When I look at the source, it seems to be only the skin <br>
> pages<br>
> that are called via oldwww.etc.<br>
</blockquote></div>