how to handle single site config including subdomain

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
farrell's picture

I'm moving my existing corporate site (html) to Drupal and want to include what had been three Wordpress installs in the single Drupal site (1 blog and 2 podcasts). I've got it all pretty much worked out ... except that one of the Wordpress installs lives in a subdomain.

I want to include that content in the main Drupal site/database so it can be indexed with everything else. The question: how do i accomplish this without setting up a second site pointing to the subdomain directory?

Can i simply use pathauto to create a url path that is the same as the existing subdomain, i.e. sitename.com/subdomain folder? Will this work?

Thanks much. My only other Drupal site is a simple single-domain configuration.

Comments

sure

greggles's picture

Yeah - that should work fine to use pathauto and htaccess rules to get this to work. I've never done it before though, so if it works out I'd love it if you could provide details to the pathauto cookbook: http://drupal.org/node/124462

There's also the http://drupal.org/project/multidomain multidomain module which does similar kinds of stuff.

--
Knaddisons Denver Life | mmm Free Range Burritos

Yes, I'll certainly write it

farrell's picture

Yes, I'll certainly write it up if it works.

I gave multidomain a quick test locally and didn't have much look getting it to work. So this subdomain idea sounds like a better solution. Thanks for the help.

site is live, multidomain idea didn't exactly work

farrell's picture

I did go live with the new site last night.

My idea to use the add-on domain and pathauto to create the multidomain site didn't work. The add-on didn't like looking for a dynamic page. It needed a physical presence in a folder to work as I'd hoped.

I did, however, redirect the add-on domain to a new URL I'd created for the podcast -- using views/pathauto -- so existing subscribers will be able to find it. Not the perfect solution, but I'm pretty happy with the overall result. I've now got a main site, blog, 2 podcasts, news feed and forum all in one place -- on one database. I used to have all sorts of separate things running: wordpress, phpBB, phplist, html site...

Thanks for the help with this.

301 Redirect

TrinitySEM's picture

You can 301 redirect from .htaccess in subdomain to new domain. Keep all the new pages and paths the same (with the exception, of course, of the domain). If you do this you may then replace all URLs like http://subdomain.domain.com/category/subcategory/page.html with http://www.newdomain.com/category/subcategory/page.html (or non www version if you prefer).

If all the categories and subcategories and file names remain the same this is a simple process. If not, you'll have a lot of hand work. To do this (In a linux box anyway) you can create a rewrite rule which replaces "subdomain.domain" with "domain".

This should preserve your backlink "mojo" as well as rankings.

This sounds like a great

farrell's picture

This sounds like a great idea. It hadn't even occurred to me...

I'll try playing with some new .htaccess rules and see if I can get it to work. I created an identical path taxonomy to the old site with pathauto, so this should work easily.

Thanks much.

It Works!

farrell's picture

TrinitySEM,

It worked. I used the .htaccess rules to send all requests for http://newdomain/pathinfo to http://domain/path/pathinfo, which I created using pathauto/views. I had to "park" newdomain before the rewrites would work.

Now, every newdomain URL is being redirected to the Drupal site, preserving all my inbound links. Perfect!

Quick question: I used a temp redirect. Is there some reason a 301 is better?

Thanks again.

Paths

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: