[pmwiki-users] IP change

John Rankin john.rankin at affinity.co.nz
Mon Apr 6 17:25:52 CDT 2015


> I am not sure I understand your kind reply.
>
> Given that the old and nonworking old url is hard-coded into the wiki.d/
> files, is there any option in pmwiki, to automatically remap
> all these links to somewhere else.

If the old url is encoded as Peter indicates:

[[http://www.example.com/wiki/Main.HomePage]]

then you could set up a local markup rule to make an automatic
redirection. In local/config.php, add the following:

Markup('urlmap', '<links', 'www.olddomain.org', 'www.newdomain.org');

This will cause pmwiki to link to the new address whenever the old one
appears in the page source.

If these pages a edited on a regular basis, you could also add a "replace
on save rule" which automatically changes old references to new ones,
whenever a page is edited and saved. However, I would wait until the
markup rule above has been carefully tested, to ensure there are no
unanticipated side-effects.

JR

> OR
> is my only option to use vi on each file, or write an awk or perl etc.
> script, to modify all the files?
>
> A second question:
>
> Is there any way to rebuld the cache (./wiki.d/pub/cache)
> There seems to be some worry that my files were hacked, and the cache
> might have been modified. It would be helpful to
> delete these files and start again.
>
> Thanks again,
>
> Jont
>
> On 04/05/2015 01:26 AM, Peter Bowers wrote:
>> On Fri, Apr 3, 2015 at 8:02 PM, Jont Allen <jontalle at illinois.edu
>> <mailto:jontalle at illinois.edu>> wrote:
>>
>>     It was necessary that I change the URL (and IP address) of my
>>     wiki. Now all the references seem to point at the old URL.
>>     For example, each of the files in
>>     /www/wiki/wiki.d/
>>     such as
>>     /www/wiki/wiki.d/Main.HomePage
>>
>>     Is there some simple automatic way to change the old URL out, and
>>     replace it with the new URL?
>>
>>
>> If you created links on your page using the [[Page]] or [[Group.Page]]
>> markup then you should not have to make any changes besides correct
>> configuration of pmwiki.
>>
>> If you created links on your pages using the
>> [[http://www.example.com/wiki/Main.HomePage]] (note that I did not
>> include "wiki.d" - that should never be part of the URL!) then you
>> will need to edit any pages with a link like that if you change the
>> URL location of your wiki. You can do this by editing the pages with
>> vi or sed, as you mentioned, but then (I think) you'll have to delete
>> your .pageindex file to make sure it gets updated. Or, if you use the
>> wiki interface itself then the updating of your pageindex will happen
>> automatically.
>>
>> *OR* you could set up .htaccess to automatically redirect anything
>> from http://www.xample.com/wiki/* to http://www.example.com/newwiki/*
>>
>> In any event, as you move forward I would recommend using the [[Page]]
>> or [[Group.Page]] markup rather than putting in the whole URL - it
>> lets pmwiki do what it does so well and avoids problems like this.
>>
>> -Peter
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>


-- 
John Rankin




More information about the pmwiki-users mailing list