I've followed this answer for running a Craft install based on two domain names. I thought it was working but either I was wrong, or something's changed, because it's not now.
I have a.com (where the Craft install is) and b.com. In b.com's index.php
I have this:
$craftPath = '../craft';
$_GET['p'] = 'subpath/' . (isset($_GET['p']) ? $_GET['p'] : '');
So that if I go to b.com/directory
it loads a page as if it was a.com/subpath/directory
.
Except it's not - it's as if it's trying to load a.com/directory
.
If I put this in b.com's index.php
(after the above):
var_dump($_GET['p']);
exit();
Then I see "subpath/directory", as expected. But if in my base layout template I put this:
{{ craft.request.getQueryString() }}
Then it shows "p=directory". So it seems like "subpath/" is going missing somewhere? I'm stumped.
UPDATE:
If I request b.com/index.php?p=directory
then I get the page I expect (ie, /subpath/directory
).