Use Domain Aliases when forming links on journal views
Short, concise description of the idea
When a journal page is viewed via a custom domain alias, use the custom domain in system-generated links.
Full description of the idea
When the domain alias (or "domain mapping", as it is sometimes called) feature was introduced, journal views served from this domain contained links that were also in the domain. This is in fact still the behavior of the generic "livejournal" version of LJ::journal_base in cgi-bin/LJ/User.pm.
However, LiveJournal.com's implementation of the journal_base hook completely disregards the $vhost argument which tells it which URL form to use. This causes journal views and feeds served from custom domains to link back to the .livejournal.com URL.
It would be good if the ljcom journal_base hook would check for the case where $vhost =~ /^other:(.+)/ and use $1 as the hostname rather than username.livejournal.com.
The code in ljfeed.pl would also need to be amended to pass the $vhost value into $u->journal_base so that the feeds use the correct domain. From reading past suggestions, I gather that this is also not done for the "Read More" links generated by lj-cut.
- The "Domain Aliasing" feature would become more useful since URLs in the aliased would be used for all journal views.
- Restores the ability offered by the generic livejournal code that was inadvertently (presumably) removed in ljcom, and extends it to feeds and lj-cut links.
- Since users cannot be logged in on custom domains, it will be necessary to find some way to make the "Post Comment" page still be linked to username.livejournal.com. One possible approach would be to not pass $vhost into that particular journal_base call, thus forcing it to use the canonical form much as the feeds currently do. This will affect the behavior of other sites using the generic livejournal code, however.
- The change to feeds will cause the URLs of entries in any feeds served over custom domains to all change, which may confuse some aggregators. Since the Atom feeds use an id other than the URL they should not be greatly affected, but the RSS feeds certainly will be. This problem ought to be only transient, and will only affect those who have subscribed to a feed via the custom domain. Since the links provided on the "recent" page are currently not to the version on the custom domain, it seems likely that most readers will be subscribed via the canonical domain and will therefore not be affected by this.