Here is the question that I am looking for an answer to.

Can I modify Drupal, or server settings or something to accompllish an About.com type navigation for a site.
By that, I mean, if it is possible to have a single database and installation and store everything in that database by categories by taxonomy terms, and then somehow display these terms as sub-domains.

Here is an example:
If you go to http://about.com/autos/, on the left you have subcategories like:
cars.about.com
usedcars.about.com
etc.

and then you have pages under cars.about.com category like;
cars.about.com/od/whatsnewfor2007/
or you may have cars.about.com/a-page.html

I am currently using Drupal/path module to categories content like
mywebsite.com/cars/
mywebsite.com/cars/a-page.html

but the question is, how to (somehow automated) make Drupal work in a way that it creates URLs like
cars.mywebsite
cars.mywebsite/a-page.html

Thanks for any help

kc

Comments

su8lime’s picture

I am working on figuring out a similar solution.

I would like to use the subdomain to show only results of content related to the same taxonomy term.

The only thing I can think of doing so far is making a major taxonomy tree that matches with a set subdomain list and then altering alot of SQL queries to integrate the subdomain to this major category.

I need this for a video games site I am working on.

Daniel Hall
www.ArcturusMultimedia.com

csc4’s picture

I'm looking at this too - I was wondering about using ISAPI rewrite to take subdomain.example.com and turn it into example.com/subdomain but while that would get them in I'm not sure whether it's ok the subsequent links would be /subdomain

I'm sure someone's done this before!

alexmc’s picture

Where is the nameserver for your domain? Do you run your own DNS server?

How familiar are you with programming a DNS server? DNS in general?

If not very then go away and learn a bit more about DNS.

druvision’s picture

I was told there is a script which does automatic subdomain creation - maybe it can help.

Me too - I am searching for it, and for how to integrate it with Drupal.

Amnon
-
Personal: Bring Dolphin's Simple Joy to your Work - Job - Career
Professional: Drupal Hebrew Consulting

tomski777’s picture

You need to use a wildcard DNS (I think that the correct way to refer to it) so
*.yoursite.com

always resolves to the same site. Then its a simple matter (if you know PHP) of parsing the URL to determine what content should be displayed.

I have this working for a multi-site setup of mine so can confirm this works.

><>tomskii
><>www.theanthillsocial.co.uk

kc’s picture

Unfortunately I am not that familiar with DNS, could you please elaborate a little bit more on how to accomplish this? Like where does wildcard DNS goes and what type of changes I need to make. Mostly server changes? or Drupal core changes too or?
BTW, I have control over server, but this is not the only site on the server so i m hoping that whatever change is required does not mess up the rest of the sites.
I appreciate help.

KC

tomski777’s picture

Firstly you don't need to make ANY changes to Drupal core. You just need to change your apache directive for the site to something like the following (you'll also need to make sure that your DNS Zone record has a wildcard setting, something along the lines of "*.yoursite.com. IN A 22.222.22.222"):

<VirtualHost 22.222.22.222>
DocumentRoot /your/site/root
ServerAlias *.yoursite.com
ServerName www.yoursite.com
</VirtualHost>

Then navigating to "anything.yoursite.com" will load the default site for your Drupal installation. Once you've got that setup then you will need to write scripts to generate your term links so you link to the desired sub-domains specific to a term, how/where you do this is entirely dependent on how you design your site.

Tom

><>tomskii
><>www.theanthillsocial.co.uk

kc’s picture

It sounds like easy task but needs some server config. I will let my server people take care of it.

Thanks a lot for the details.

kc

markDrupal’s picture

I love to see some more details on how you are able to integrate this with drupal.
This is just the idea I have for a site I am about to make.

==EDIT==
I found this site that talks more about doing this, maybe it would help you
http://forums.skejo.com/showthread.php?p=210

chadj’s picture

One small point: if you use multiple subdomains, you have to remember to set the cookie as both "mysite.com" and ".mysite.com" so that sessions span across subdomains.

The big problem, it seems, is getting Drupal to play along! Does anyone know how to get drupal to actually generate URLs in a custom pattern?

This is also being discussed at: http://groups.drupal.org/node/2619

- Chad

hf’s picture

Hi guys,

I am looking for the same, and I am very interested in your solution.

hf

indeman’s picture

I looked up http://forums.skejo.com/showthread.php?p=210 as suggested here to learn about using sub-domains for certain categories or sub-categories. Has anyone done it?

Would it be better to explore creating a separate site within the same drupal install? I have certain additional features on these sub-domains that I dont want to install or use in the main site. How will different sites work together when i want to link back and forth between them?

summit’s picture

Hi,

Any progress in this field.
Is there a possibility to get user.mydomain.in/node_title subdomains automated working related to the login procedure and when a user gets an account, he also can get a subdomain like user.mydomain.in ?

Please respond, this is a big thing and can help lots a user as I see in the messages.
greetings,
Martijn

nerkn’s picture

I've tried
RewriteCond %{HTTP_HOST} ^ehliyet.sinav.web.tr [NC]
RewriteCond %{REQUEST_URI} !^sinavi/ehliyet/.*
RewriteRule ^(.*) http://www.sinav.web.tr/sinavi/ehliyet/$1 [L]

but it redirects :( and address bar changes. Also I need to make entries for each category entry (It does not much 6 of them)

spicyguy’s picture

You may have resolved this issue. But just in case....
Have you tried Taxonomy Redirect?