- I've installed Drupal at www.domain.com (root)
- Created a subdomain as http://blog.domain.com
- Using Clean URL and a Blog module enabled as http://www.domain.com/blog

>> How to make http://www.domain.com/blog appear as http://blog.domain.com, and each blog entries as (example) http://blog.domain.com/2006/07/24/test ?

Comments

pbarnett’s picture

Provided that requests to the subdomain are already setup by DNS to route to your webserver, you need to add it as a virtual server; in Apache's httpd.conf, add something like

NameVirtualHost *

<VirtualHost *>
  ServerName www.domain.com
  DocumentRoot /home/httpd/htdocs/
</VirtualHost>

<VirtualHost *>
  ServerName subdomain.domain.com
  DocumentRoot /home/httpd/htdocs/subdomain/
</VirtualHost>

More detailed information at http://httpd.apache.org/docs/2.2/vhosts/examples.html

khanvanna’s picture

Hi pbarnett,

I host the web on a paid server - I could not access the httpd.conf file.
Actually, I have a domain www.icambo.com with clean url and autopath enabled. My blog module is virtually seen as www.icambo.com/blog, but I want it(also its entries) to be accessible as http://blog.icambo.com instead.
Please note that, I don't need Redirect or Masked forward.

pbarnett’s picture

I _think_ this can be done using rewrite rules in your .htaccess file; might be worth checking with your ISP to see if the setup allows that...