This may be by design, but I thought I'd bring it up since it isn't the behavior I was expecting from this module:
When I type a drupal-style link (just a regular "a href="/node/1"" tag) in a page, block, etc., it links to that path on the current subdomain, rather than on the main domain, and there is no way (that I have found) to specify a subdomain in links without resorting to absolute urls.

FOR EXAMPLE

If I make a block that is visible everywhere, and then put a link such as /user/register in that block, this is what happens:
-If I am currently looking at mysite.com, the link in the block will be mysite.com/user/register
but...
-If I am looking at subdomain1.mysite.com, the link will point to subdomain1.mysite.com/user/register ... a broken link.

What if I want to specify a subdomain in my drupal link? Based on the special properties of the ~ character in this module, I expected to be able to link to something like this:
/~subdomain1.mysite.com/my-page-on-subdomain1
but again, the link resolves instead to mysite.com/~subdomain1.mysite.com/my-page-on-subdomain1
(depending on what subdomain I am currently browsing)

Of course, one simple fix would be for me to modify my expectations! But I thought I would check with you all, and see if anyone else thought that this module ought to act the way I have described, and if so, what it would take to implement a fix.

Comments

colemanw’s picture

I've kept on trying, but so far the only solution I've found to this is to use a little bit of php in the text of the node or block. Yuck!

So, for example, to link to a page on my site's blog subdomain, I'd write the link like this:

<a href="http://blog.<?php
global $base_url; echo str_replace("http://", "", $base_url);?>/path/to/page">

Am I missing something obvious? Ideas welcome.

colemanw’s picture

I think this was a dumb question, sorry.

p.s. don't use the code above, use the l() function.
pps. the l() function could be pretty easily rolled into a token, if you don't like php.

colemanw’s picture

Status: Active » Closed (fixed)