I'm interested in using Domain Access to run a few sites. I'm wondering if it's possible to incorporate a path for the domains under the main domain, e.g. http://nbog.us/zewski (it incorporates my last name into the URL). I've been using an .htaccess file at the site's root folder to redirect, but since Domain Access does away with the folders, I'm not sure how to approach this. Any insight would be great.

I'm currently exploring this on Drupal 7, with Domain 7.x-2.5 and all its component modules installed.

I thought I might be able to use Pathauto to my advantage here, adding the zewski/ to every node, but this still leaves me with a default page that appears to be at the domain root.

Comments

agentrickard’s picture

Issue tags: +handbook

Essentially, you want '/zeweski' to act like 'zeweski.example.com'?

See the discussion here: http://yubastudios.com/blog/drupal-domain-access-and-sites-in-subfolders

I think there is a potential solution by allowing domain records to register site paths, so that hook_url_inbound() can recognize them. It may also be possible in hook_domain_bootstrap_lookup() to do this conversion, simply noting that the path is registered to a specific domain.

nateb’s picture

Essentially, yes, that's one way to look at it. My concern is principally about the appearance of the URL though I'd like to keep things from getting too confusing for purposes of SEO stuff.

I've not been able to get things working based on the information at the link. My coding experience is limited and I'm not sure I follow the method in place there, particularly where to put the paths as variables. I reckon I may be just missing something simple.

agentrickard’s picture

Version: 7.x-2.5 » 7.x-3.x-dev

New features go in 7.x.3. This is on the hit list, but if someone gets to it first...

agentrickard’s picture

Title: Paths in non-primary domain » Register subfolders as subdmains
Component: Miscellaneous » - Domain Alias

Re-titling. Technically, this seems like a flavor of an 'alias' to me.

agentrickard’s picture

Title: Register subfolders as subdmains » Register subfolders as subdomains

Another title fix.

Here's the plan:

-- Allow each domain record to be registered with one or more 'folder' or 'path' matches.
-- On hook_domain_bootstrap_full(), load the domain (if any), corresponding to the inbound path.
-- Either a) issue a redirect to the proper subdomain or b) use hook_url_inbound_alter() to hide the path directive as necessary.
-- Use hook_domainload() to alter the path element of the domain.

benanderson’s picture

subscribing

agentrickard’s picture

This is partially blocked by #1096566: hook_domain_bootstrap_lookup() fail if multiple responses and would be built as a stand-alone module.

I have some sandbox-able code if anyone wants to co-maintain.

ejustice’s picture

Issue tags: -handbook

I'd be interested in this as well as we'd like to have some sites that are treated as subdomains and others as subdirectories.

agentrickard’s picture

Status: Active » Fixed

Let's set up a proper sandbox in Git, then.

http://drupal.org/sandbox/agentrickard/1175752

Development is in the 7.x-1.x branch. @ejustice has Git access.

Note that there will need to be patches to DA 7.x-3.x to support some of this.

See #1096566: hook_domain_bootstrap_lookup() fail if multiple responses for the first blocker.

All other issues can be posted to the sandbox project.

adamhoyle’s picture

Status: Fixed » Needs work
agentrickard’s picture

Status: Needs work » Fixed

No. This issue is fixed. Development moves to the sandbox project, which has its own issue queue.

We probably need to port #1096566: hook_domain_bootstrap_lookup() fail if multiple responses to 7.x.2, so that one will need reviewers.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

protools’s picture

Status: Closed (fixed) » Active

any news about support subfolders ? patch for #1096566: hook_domain_bootstrap_lookup() fail if multiple responses committed.

agentrickard’s picture

Status: Active » Closed (fixed)

Please ask that question on the proper issue instead of re-opening closed tickets.

zmove’s picture

Issue summary: View changes

Any news about that ? I see that there are several sandbox project about that, but nothing consistent and usable whereas the issue have several years old now.

1kenthomas’s picture

Ping. Any traction? Subproject seems mort. (I would swear there was a solution for this via .htaccess in D5...)