Hello,

I have my froum at /drupal.site/forum. I created subdomain forum.drupal.site via dreamhost panel. What magic should I do to apear my /drupal.site/forum content at the new forum.drupal.site?

The more detailed instruction for dummies you can provide,the less questions I'll ask. I'm complete novice in subdomain issue, especially in Drupal. Thx.

Comments

sanduhrs’s picture

did you point the subdomain to the drupal install folder ?
if no, do it.
Then create a new folder in /sites, name it /forum.drupal.site and copy the settings.php into it.
Change the settings to your needs.

profix898’s picture

In case you only want to redirect forum.drupal.site to drupal.site/forum. And dont want to have a new
site bound to it. You can create the subdomain, point it to your drupal.site (base) directory and add

RewriteCond %{HTTP_HOST} ^forum.drupal.site$
RewriteRule ^(.*)$ http://www.drupal.site/forum/$1 [R=301,L]

to your Drupals .htaccess.

Continental’s picture

I do not want to redirect. I applied rewrite rule in .htaccess and by typing forum.drupal.site I automatically go to drupal.site/forum. I don't want to. I want to type forum.drupal.site and stay here and see forum here (which is originally is under /forum folder in the base site).

The first reply is closer. Before I made everything exept pointing on the base directory. Thank you. But now by typing forum.drupal.site I see the main page. But I want to see the forum page. How can I fix it?

bonobo’s picture

and the directions are in this thread.

Hope this helps.

Cheers,

Bill

-------
http://www.funnymonkey.com
Tools for Teachers

profix898’s picture

Nice! :) But the new subdomain will belong to a completly seperate site
then!? Right? I think Continental wants just his one site, but navigate to
forums when somebody calls forum.his.site.

sanduhrs’s picture

Under /admin/settings set Default front page to forum.

Continental’s picture

But If I set default from page to Forum, then I will type drupal.site and go to /forum. No.

I want to type: drupal.site and go to /node (or just "/"), and not /forum.

Also type: forum.drupal.site and see forum => "forum" this is a content that I now see at drupal.site/forum. But I want it to see forum on the root.

Yesterday I already tried to use magic symlinks, but it completely crashed my site and didn't follow the result. I had to delete all symlinks. I'm not sure why should I I see them in my case?

I want one site. Ono content. No multisites. No redirects. One base. But: two domain. with dirrerent frong-pages depending on waht we type. it's should be ease, (or impossible).

?

sanduhrs’s picture

I thought you'd want a mutli-site.

When you set up your subdomain, you should have been able to choose wether to point it to a folder or to redirect to a URL.

So, if you don't want it to point to a folder choose redirect and point it to http://yourdomain.tld/drupalinstall/forum .

kvarnelis’s picture

your request is confusingly worded, which is why we're having trouble answering you, but i think what you want is

one drupal install

forum.example.com -> example.com/forum but with forum.example.com in the address bar

while

example.com->example.com front page

in that case, ask your ISP to redirect your subdomain to example.com, but modify your page.tpl.php file in your drupal theme to take account of the other domain and respond accordingly. this isn't something that you can expect in drupal for dummies, unfortunately, so you'll have to learn a little something about themes and perhaps php as well. what you'd want to do is have the code for your forum execute based on whichever subdomain the user was coming from.

i have a similar feature (two front pages, based on what domain the user comes from) working at my site and wrote up the results here: http://drupal.org/node/47646

there'll be some tricks, like ensuring that any URLS that link to the rest of your site are absolute and not relative so that they point to example.com, not forum.example.com and you may have trouble with logins (my site doesn't have open logins, but if i come in via the subdomain, i no longer have admin access). wish it were easier, but you're asking drupal to do something pretty tough to do and it's amazing it can pull it off in the first place.

Continental’s picture

So, I made via panel new forum.example.com. It points to the /home/users/example.com folder on my server. It's ok. Also I made changes in /sites/ by creating /forum.examlpe.com/setting.php. Hope, I don't have to delete it.

Now as I could understand I should write in my template the condition like (no syntaxis, only idea)
IF HTTP_HOST = forum.example.com {
...what? i need to show /forum content here
} else { show other content }

Hope, it wil not redirect me to forum.example.com/forum.

p.s. I also use front_page module for registed/anonymous users, so I'm doubt if there will be ok with this.

Continental’s picture

Yes, I have several options. One of them, is redirecting. So if I redirect to URL http://mydomain.com/forum the address will momentally change to http://mydomain.com/forum if I type http://forum.mydomain.com. But I do not want be forwarded like this.

sanduhrs’s picture

Isn't there an option like a framed redirect or similar?

bonobo’s picture

If I think I understand what you are attempting, this should do it. As you say you don't want multi-site, this will get your site installed and working in your subdomain.

1. Create your subdomain using cPanel.
2. Install drupal in the folder created in step 1.
3. Edit your settings.php file in sites/default folder. Make sure the db settings connect with your current drupal db

And, that ought to do it. From what you describe, there isn't any need for any .htaccess edits at all.

Assuming, of course, I'm understanding you correctly -- from your first post, I thought you were looking to implement multi-site from one codebase.

Hope this helps.

Bill

-------
http://www.funnymonkey.com
Tools for Teachers

kvarnelis’s picture

sorry, i just have no idea what you're trying to accomplish, your posts don't give enough information.

Continental’s picture

Forget about forum, I decided to use just example.com/forum, but I still didn't understand how could I do what I wanted and will need to do later...

Real example:
Here is my lj' account: http://kost1k.livejournal.com/
Previous it were: http://www.livejournal.com/kost1k

When I navigate of my personal lj's site links are:
http://kost1k.livejournal.com/calendar
http://kost1k.livejournal.com/friends e.t.c...

How do the did it? Please, ask if you can, considering this example to Drupal.

E.g. I have 10'000 users (it's only example, but this amount must eliminate any suggestions to install many drupal codes, co create many drupal sql-bases e.t.c - code, base and data is only one).

By default, user's page is on:
http://drupal.org/user/41371 (my account)

How Can I do the same content by the:
http://41371.drupal.org/ ??? THAT'S THE QUESTION.

I don't ask how to make it to 10'000 users, it's next step, now I can't understand how I can make it at least with ONE user (me for example). Don't ask what how I will do it. The same like LJ: the user will navigate it's profile (and may be blog) from this personal domain.

On Dreamhost I have few choises when creating subdomains:
Fully Hosted
Redirected - A redirect to another site; browser URL changes.
Mirroring - A "mirror" of another site's content; browser URL remains the same.
Parked - A place-holder web site with a generic DreamHost 'coming soon' message.
Cloaked - "Mirroring" for any URL.. uses a frame so browser URL doesn't change.

I tried almost everything except "Parked" but no one method didn't give me the result. Even the "mirroring" which is seem to be what I need in fact made redirect and my URL changed and for cloacking the same. =( I am not sure, I tried this 2 weeks ago, but at that time I didn't find anything that allowed me:

- browse the content from the www.example.com/somefolder
- being on the http://omefolder.example.com in the browser.

Continental’s picture

To solve this complicated issue I need some kind of detailed answer in complen on the following qeustions:
- which type of sub-domain should I create?
- which folder/url should I point?
- what should I write in in .htaccess?
- what folders should I created in /sites/.../setting.php
- smth else... If smbd answer "just do that or that" => I don't know which parametrs should be in other items... =(

sanduhrs’s picture

- To your apache configuration file add something like
ServerAlias www.domain.tld user01.domain.tld user02.domain.tld userXX.domain.tld
- Copy the default settings.php to new folders folders like:

/sites/user01.domain.tld/settings.php
/sites/user02.domain.tld/settings.php
/sites/userXX.domain.tld/settings.php

- in all settings.php change the base_url to match your ServerAliases (and folder name) like

$base_url = 'http://userXX.domain.tld';

- in all settings.php set the frontpage accordingly (this is untested):

$conf = array(
  'site_frontpage' => 'blog/XX',
);

This should result in having one code-base, using one database, and having multiple subdomains pointing to your setup, but with different frontpages.

Please report, if it's working.
vg

Continental’s picture

Fantastico!!

Commnets:
First point is unpossible, as I'm on shared hostnig. I used Fully Hosted option for user.example.com sub-domain and pointed it to folder /home/.../examlpe.com (main domain folder).

btw, it is the same what is ServerAlias? Don't I need to create this sub-domain?

It's working as I need!!! At least for the first glance, I need to test it and find right appliacation before I can say something more...

where can I find more docs on this "untested" function and what is your recommendation about using it (or not using)?

Is there any instrument to clone all this settings upon new user registration?

sanduhrs’s picture

ServerAlias and subdomain are different things, but if it's working for you by adding a subdomain, this should be alright (look at apache.org for definition of ServerAlias).

"untested" simply meant I didn't try it myself.
you may have a look at your settings.php, at the bottom it says:

/**
 * Variable overrides:
 *
 * To override specific entries in the 'variable' table for this site,
 * set them here. You usually don't need to use this feature. This is
 * useful in a configuration file for a vhost or directory, rather than
 * the default settings.php. Any configuration setting from the 'variable'
 * table can be given a new value.
 */
//$conf = array(
//  'site_name' => 'My Drupal site',
//  'theme_default' => 'pushbutton',
//  'anonymous' => 'Visitor'
//);

So then have a look at your variables table, to check which variables you may override ;)

I don't know of any scripts that are capable of doing so, but you may try to do one, ore have a look at http://cvs.drupal.org/viewcvs/drupal/contributions/tricks/sympal_scripts/, perhaps it's something in there, which is of use for you.
vg

gemini’s picture

This is a good beginning, but not good enough to run on a production site. In my case I want only "story" content type (www.example.com/blog) to be on the "blog.example.com/" subdomain. I followed the instructions above and everything seam to work fine except the navigation URLs which do, in fact, inherit the subdomain's URL in their links. So, suddenly I have all the content available on the site via subdomain that was only meant for the blog. This creates a problem of a duplicate content. I probably could create a template just for the story type content that would have hard-coded navigation, but that's an ugly way to go.

Any ideas on how to finalize this implementation?

Thank you.

sambtaylor’s picture

I would like to know this too. I am not even clear from the above discussion whether there is any verdict that it is possible. So, let's say this: it would be wonderful if this were possible AND if there were clear instructions to do it AND better yet if it could be made to happen easily. Perhaps this is a project for Drupal 7. Since there was so much confusion about what was being asked, and since anyone (like me or the last commenter) who already wants to do this and reads this post knows immediately what the person is asking (it did not seem unclear to me), I want to clarify it.

We would like a relatively simple way to rename a portion of a single drupal site as a subdomain that
1) can have its own front page
2) that retains its subdomain url and does not have extra directories appended to it (i.e. example.com/category becomes category.example.com not category.example.com/category— **note that, at least for me, example.com/category/title would have to become category.example.com/title**. Substitute user or blog or forum or whatever.
3) that still contains content from the whole site and is part of the same site, database, userbase, etc., but that
4) at least for some drupalers, might not allow access to all parts of the site through that domain (Tho I don't need this)

In essence then, we are talking about an autopath like function that coordinates with certain pre-set up domain names.

I have no idea how feasible this is. It's a nice wish list. It could have an endless number of useful applications. So, now can anyone who knows more than us tell us if this is possible and/or if it could ever be simple.

summit’s picture

Hi,

Subscribing. I asked for allmost the same thing: http://drupal.org/node/185196
Greetings,
Martijn
www.reizen-en-uitjes.nl
www.gratis-informatie.nl

altcadv’s picture

After following all the directions all of you gave in this thread as follows:

Created subdomains as subdomain1.mydomain.com, subdomain2,mydomain.com.....

Deleted folders that cPanel created.

Symlinks were created by my hosting provider.

In sites folder I created subfolders as sites/subdomain1.mydomain.com, sites/subdomain2.mydomain.com...

I copied and pasted settings.php archive into every subfolder in sites folder.

Untill here, everything OK.

I've added at the end of settings archives the following:

$conf = array(
'site_frontpage' => 'XXXXXXX',
);

where XXXXXXX is the address of your new frontpage for those subdomains you created. No trailing slashes at the beginning or ending.

An example as follows:

$conf = array(
'site_frontpage' => 'forum',
);

This added code is for my forum.mydomain.com, where www.mydomain.com/forum is the main page for forums. It stands on forum.mydomain.com without redirecting. One code, lots of subdomains, one DB, every subdomain pointing at one page on my site.

Regards

altcadv

softtouch’s picture

Thats nice, BUT:

if the subdomain is forum.example.com, it stays there, fine, but all menu links are pointing to forum.example.com/xxxx, so the forum link too: forum.example.com/forum... that is anyhow nonsense, right?

yngens’s picture

subscribe

Pushkar Gaikwad’s picture

do

dorien’s picture

subscribing

summit’s picture

I may be introduce a stupid link...bit what about the domain_access moduleset http://drupal.org/project/domain ?
Will this not be helpfull with this?

Greetings,
Martijn
www.trekking-world.com

dorien’s picture

Not so stupid to me

vinoth.3v’s picture

HI

Use the following combination

subdomain module
domain module / virtual_site
pathauto module

வினோத் - Vinoth

Vinoth - வினோத்

sanatate’s picture

Hi 4vinoth,
can you please write here a short "tutorial"? I'm trying to do this, but without success.

Thank you!

http://www.i-medic.ro

problue solutions’s picture

Very old thread, but I'm trying to do exactly the same thing and have tried lots of different techniques and even hired a few contractors who were unable to complete the task.

Closest i've got is having the site replicated on the subdomain using the same database etc but the problem remains that all the internal paths are written to the subdomain when I only require specific paths to be served on the subdomain, exactly as described in many of the posts above.

Is this just not possible?

tahiticlic’s picture

Same need here too.

Drupal rocks!
www.tahiticlic.com

vinoth.3v’s picture

1. Create a separate forum site from same code base of main site (i.e. multisite setup) for sub.example.com with only needed modules enabled (so it takes less memory) and link it from main site. this setup gives you the clear separation of main site and forum site.
And you have to use the same accounts, sessions table for both sites, see multisite setup documentation.

OR

2. Use your favorite modules domain, subdomain or sites and configure the way you want.

*for those who have redirect issues or wrong menu path, you can use the apache or nginx rewrite to direct some paths of sub domain to main site or main site to sub site.

Vinoth - வினோத்