Satchel
Satchel

Reputation: 16734

How do I create subdomain redirects using .htaccess?

I have a main domain MYDOMAIN.COM

I want to make it easy for me to remember my Google Apps email URL, so I just want to redirect gmail.MYDOMAIN.CCOM to my Google Apps email URL using .htaccess to do a redirect.

How do I do this?

Upvotes: 0

Views: 951

Answers (3)

gahooa
gahooa

Reputation: 137332

A slightly indirect answer...

Why don't you just setup DNS for gmail.mydomain.com and instruct Google Apps (via admin panel) to respond to that subdomain? The instructions are right in the admin panel, and very simple to follow.

It's a snap.

Upvotes: 0

Matthew Scharley
Matthew Scharley

Reputation: 132274

To expand on @Matthew Iselin, this should work in a .htaccess in the directory that represents the root of your subdomain:

RewriteEngine on
RewriteRule ^/(.*) http://wherever.gmail.com/

or whatever the url is.

Without mod_rewrite, you can use mod_alias:

Redirect permanent / http://wherever.gmail.com/

Although, the mod_rewrite solution is "better", it's not enabled on all server. mod_alias however should be.

Upvotes: 1

Matthew Iselin
Matthew Iselin

Reputation: 10670

Assuming Apache, mod_rewrite will allow you to create redirects like this.

Upvotes: 0

Related Questions