[pmwiki-users] Cross-site variables
Petko Yotov
5ko at 5ko.fr
Mon Jul 25 16:12:29 CDT 2016
On 2016-07-24 23:03, kirpi at kirpi.it wrote:
> I have two websites in a cheap, shared hosting service, so most
> probably
> running in different servers outside my control.
> Say one is example.com and the other one is example.org
>
> Is there any way to "read" the PTVs of one site and show them on the
> other
> one?
> If I set $:VariableX on www.example.com/Group/Page there is absolutely
> no
> way to let someone type www.example.org/Group1/Page1 and have the
> $:VariableX displayed?
If the two wikis share the same wiki.d directory (same custom $WorkDir),
and if both the group and the page names are the same, then it is
possible.
If they share the same wiki.d directory, and if the group and/or the
page are not the same, you in one you can read the variable from the
other:
in Group1.Page1: {Group.Page$:VariableX}
Or, you can make PmWiki believe the page name is Group.Page in
config.php:
if(preg_match('/^Group1[.\\/]Page1$/', $pagename)) $pagename =
"Group.Page";
but then PmWiki will read from the file Group.Page not from
Group1.Page1.
> As an alternative, no way to "rewrite" the www.example.com/Group/Page
> url
> to appear www.example.org/Group1/Page1 ?
To send the browsers to the other domain, in the .htaccess of
example.com you can add a redirect:
Redirect temp /Group/Page http://www.example.org/Group1/Page1
(or "Redirect permanent ..." after you tested it and it works as
expected.)
If both domains operate from the same document root, as well as share
wiki.d, you can also use url rewriting:
RewriteEngine On
RewriteRule ^Group1/Page1 pmwiki.php?n=Group.Page [L]
Petko
---
Change log : http://www.pmwiki.org/wiki/PmWiki/ChangeLog
Release notes : http://www.pmwiki.org/wiki/PmWiki/ReleaseNotes
If you upgrade : http://www.pmwiki.org/wiki/PmWiki/Upgrades
More information about the pmwiki-users
mailing list