Author Topic: How to make: mail.site.com to www.mail.site.com ?  (Read 6044 times)

Offline inf4mi

  • Jr. Member
  • **
  • Posts: 12
How to make: mail.site.com to www.mail.site.com ?
« on: April 11, 2007, 05:49:52 PM »
How to make:  
When user prints mail.site.com , but it is automatically goes to http://www.mail.site.com ?

Thank U!

Offline _AA_

  • Newbie
  • *
  • Posts: 1
Re: How to make: mail.site.com to www.mail.site.com ?
« Reply #1 on: April 12, 2007, 04:14:09 AM »
From the .htaccess file that comes with drupal.

 # If you want the site to be accessed WITH the www. only, adapt and uncomment the following:
 # RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
 # RewriteRule .* http://www.example.com/ [L,R=301]
 #
 # If you want the site to be accessed only WITHOUT the www. , adapt and uncomment the following:
 # RewriteCond %{HTTP_HOST} !^example\.com$ [NC]
 # RewriteRule .* http://example.com/ [L,R=301]


Also, make sure you server name is mail.example.com and not http://www.mail.example.com or something similar.

Offline inf4mi

  • Jr. Member
  • **
  • Posts: 12
Re: How to make: mail.site.com to www.mail.site.com ?
« Reply #2 on: April 12, 2007, 05:07:07 PM »
Quote from: _AA_
From the .htaccess file that comes with drupal.


Also, make sure you server name is mail.example.com and not http://www.mail.example.com or something similar.

I also tried this way - but for this mail - it doesn`t work

But
Thank U

Offline flosoft

  • Sr. Member
  • ****
  • Posts: 349
    • http://flosoft.biz
Re: How to make: mail.site.com to www.mail.site.com ?
« Reply #3 on: April 25, 2007, 09:51:07 AM »
try it with a simple PHP redirect?

http://be.php.net/manual/en/function.header.php

header("Location: http://www.example.com/"); /* Redirect browser */

/* Make sure that code below does not get executed when we redirect. */
exit;
?>