How to generate subdomains in Drupal URLs based on content type?
I hope it's ok to post this here. I first posted this question in the support forums -- but it was suggested that I post here instead since it's a path question.
I'm totally new to Drupal but experienced in SEO and PHP. I've always rolled my own crappy CMS because of custom needs. I'm REALLY hoping Drupal will help me to stop this wasteful methodology.
The main thing I need to figure out is how to take full control of Drupal URLS. My future sites need simple URLs in the style of about.com wherein each subject or content type is assigned a unique subdomain (one site, many dynamic subdomains like http://dogs.about.com, http://cats.about.com).
All incoming subdomain links are directed to the base folder where an HTACCESS file does an internal URL re-write (no redirects) for Drupal. This part is easy for me so this is NOT a question about DNS or HTACCESS.
What I need to know is how to get Drupal/Path-auto etc. to generate (alias?) links using my pattern? Here's the URL pattern (with no subdomain for the default type "pages"):
http://[content-type].domain.com/[pathauto-node-title].htmlit would look something like this:
pages: http://domain.com/[node-title].html
forums: http://forum.domain.com/[node-title].html
blogs: http://blog.domain.com/[node-title].html
articles http://article.domain.com/[node-title].html
news items: http://news.domain.com/[node-title]-[date].html
newsletters: http://newsletter.domain.com/[node-title]-[date].html
secure: https://secure.domain.com/[node-title].html I'm looking in Pathauto but it doesn't seem to allow defining the entire URL. I hope I'm just missing something obvious. Does the "alias" hold an entire URL or just the path part?
I've searched around in the forums and the other subdomain questions seem to deal with DNS, HTACCESS, redirecting etc. and not how to get Drupal to create links using the pattern. Perhaps this part is already too obvious?
Thanks,
Chad

paths
Pathauto is really just a means to create paths. So, if this can be done with drupal core path.module then pathauto can do it.
Onfortunately, I think the only way to get that is using the htaccess tricks you mention above (which I frankly don't actually know that well).
--
Knaddison Family | mmm Free Range Burritos
path.module?
The .HTACCESS part is really easy, you just use a Regex expression to grab the subodmain and reformat it into whatever format Drupal prefers.
The part I'm not clear about is how to get Drupal to generate the subdomain links. How can path.module be used to output urls in the form of http://[content-type].domain.com/[title] ?
I can look through the code myself if someone can point me at a good starting place. Where does Drupal construct URLs for links?
A good starting point...
... might be the new localizer.module! It supports
While this is not exactly what you are looking for, I suspect that the way they do that subdomain switch is of great help for your problem... You can directly browse the module code at the CVS repository.
Hope this is of any help for you...
Pancho
Multidomain module
Take a look at the Multidomain module. Isn't that exactly what you need?
Pancho
path.module
it's generated in path.module
Take a look at function path_set_alias($path = NULL, $alias = NULL, $pid = NULL) { on line 135.
Greg
--
Knaddison Family | mmm Free Range Burritos
some documentation
Partially as a result of your post, chad, I spent some time today writing and fixing up the pathauto documentation in the handbooks.
In particular I
Wrote this page of recipes that talks about patterns with static entries per content type: http://drupal.org/node/124462
And updated the page about "dangerous paths" http://drupal.org/node/73232
There's still lots of room for improvement, particularly on the "tips" page at http://drupal.org/node/86994
I encourage everyone who can (which is everyone...really...) to read the docs and help provide more pointers on how you like to setup pathauto. If you can't edit the book just comment on the page.
Thanks!
Greg
--
Knaddisons Denver Life | mmm Free Range Burritos
Did someone ever figure out
Did someone ever figure out how to do the subdirectly via content type?
I will be creating a drupal site with a forum, blog, windows programs and mac programs. I would like to put the forum, blog and mac programs each on their own subdomains each with unique homepages, but I would like to run this all off 1 Drupal installation.
Any ideas on how I can achieve this?
Freelance Web Design
That is the same point ...
Hi, subscribing. I stopped at the same stage of development. Being very intersted in the further approach of this. Cheers
.davidnaian