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?
-
Answer:
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.
Angela at Stack Overflow Visit the source
Other answers
To expand on http://stackoverflow.com/questions/1051886/how-do-i-create-subdomain-redirects-using-htaccess/1051898#1051898, 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 http://httpd.apache.org/docs/2.0/mod/mod%5Frewrite.html, you can use http://httpd.apache.org/docs/2.0/mod/mod%5Falias.html: Redirect permanent / http://wherever.gmail.com/ Although, the http://httpd.apache.org/docs/2.0/mod/mod%5Frewrite.html solution is "better", it's not enabled on all server. http://httpd.apache.org/docs/2.0/mod/mod%5Falias.html however should be.
Matthew Scharley
Assuming Apache, http://httpd.apache.org/docs/2.0/mod/mod%5Frewrite.html will allow you to create redirects like this.
Matthew Iselin
Related Q & A:
- How do I issue multiple commands using telnet or netcat?Best solution by Super User
- How do I create a digital signature and how do I use it?Best solution by support.office.com
- How do I create a new Yahoo screen name if I already have one?Best solution by Yahoo! Answers
- If I have a form, such as an application, how can I fill it out using my computer?Best solution by answers.yahoo.com
- How Can I Create an XML to Create a Menu?Best solution by Drupal Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.