Htaccess for blog on site


#1

Hi there, sorry for being stupid but I can’t figure this out and really need some help from you guys. I have a CMS website hosted on dreamhost… virtual server, not dedicated, no static ip, no ssl.

Lets call it mysite.com It has a blog section: mysite.com/blog and multiple blogs as in mysite.com/blog/myblog1 and mysite.com/blog/myblog2 etc…

I would like to use htaccess rewrite so that I can use blog.mysite.com instead of mysite.com/blog

Specifically, I’m hoping for this outcome:

1.a) People typing mysite.com/blog get redirected to blog.mysite.com and,
1.b) The address bar automatically changes to display blog.mysite.com
2) mysite.com/blog becomes blog.mysite.com
3) mysite.com/blog/myblog1 becomes blog.mysite.com/myblog1 AND mysite.com/blog/myblog2 becomes blog.mysite.com/myblog2 AND any new blog created by users to follow this rule without having to edit htaccess for every new blog added, I’m thinking of a wild card here like '’.
So, mysite.com/blog/
becomes blog.mysite.com/*
4) Automatically generated ‘internal’ website links to these blogs are in the form mysite.com/blog and cannot be changed So it would be awesome if htaccess can override every link on the website that’s in the form of mysite.com/blog/* to actually show as blog.mysite.com/*.
If #4 is not possible I can live with this as long as #1.a and #1.b above are occurring.

I did try modifying my site’s htaccess but that didnt work and returned errors. I’m new to modifying htaccess. Do I need to create a subdomain in my control panel in the form of blog.mysite.com or is htaccess is all I need?

Thank you in advance


#2

Is this blog a One-Click install? In other words, if you can physically move it to another directory, then this would be quite a bit easier. And what software is the blog?

-Scott


#3

Thank you.

Actually it is a Drupal website (you can download the Drupal CMS from www.drupal.org), this one is not a one-click install.

It’s installed on the root of my site. By default Drupal’s blogs are not sub-domains, I heard that htaccess can be used to rewrite URL rules. Problem is I’m very new to editing htaccess.


#4

Anyone out there that knows how to edit .htaccess?


#5

Edit .htaccess yes, for Drupal, no. Drupal has its own extensive mechanisms for URL re-writing. I think you can do what you want, just be aware that you need to coordinate this so that Drupal starts working on the path after you tweak it. However… If you tweak the path from mysite/blog to blog.mysite, then Drupal doesn’t know what page you want.

In addition to trying to get a response here, I suggest you make inquiries at Drupal.org, and/or with a local community group of Drupal users. In the southern California area where DH is based, for example, there are a few groups that meet periodically, and people there participate in various specialty groups at groups.drupal.org. I think you’ll find the answers you need somewhere among the various resources available.

HTH