I have searched for help to no avail. I am trying to get a sub domain with a different theme, same codebase, same content working (I am not sure if I am going to use the same content yet, probably not, I am just trying to get the multi-site feature working). I created a folder in the sites dir sub.example.com and copied the edited settings.php into it. $base_url = 'http://sub.example.com'; I copied the new theme folder into the dir sub.example.com. Not sure why it doesn't work when I go to sub.example.com in a browser. It should pull the same content as example.com if I leave the $db_url the same, right? What else do I need to do? Edit .htaccess? Forgive my ignorance. Thanks in advance.
Comments
The easy or the hard way?
If you needed to change other setting besides the theme, I would recommend splitting up the database and sharing some tables BUT if I'm reading right you only want to change the theme. Is that correct?
If you look at the end of the settings.php file you'll see:
Uncomment that and change to be:
...and you should have the new theme on that subdomain.
Have you configured you webserver
to answer to both hostnames?
eg on an Apache virtual host container, you'd probably need to do something like add a ServerAlias directive so that requests for sub.example.com are also served from your Drupal directory.
--
Anton
That sounds closer but...
My hosting provider will let me create a sub domain but that domain creates an empty dir that wants an index file. I am sure this is more of a website issue. Any other ideas? Can I put an index file in the new subdomain dir that redirects?
I will want different content eventually. I just want to get this running first.
Not sure, but...
can you use a symlink pointing to the parent directory?
But really, your host should let you have another alias or even a wildcard so that your root directory picks up *.example.com.
Let them know that you want both (or all) hostnames to point at your root directory. This is IMO easier to set up than their subdirectory method. I assume the only reason they give you a subdirectory, is they are assuming you want different content in there, whereas you really want the same content in there and to let Drupal do the figuring out of hostnames.
Think about asking for an alias for the main site rather than a new subsite.
Does that make sense?
--
Anton
Support response
They said they cannot do ServerAlias directives but they said I could put a .htaccess in the subdomain folder:
and that would redirect...but it did not work... Everything with drupal has been so easy and just worked. *trip scratching head*