Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was using Droplr with my domain, '', prepended with 'u.'. ( The prepend was not a subdomain, and would redirect to Droplr via an A record to their server's IP Address.

Edit ---

In other words, I didn't create as a subdomain of, but rather created an A record to make it act like a subdomain.

However, I changed the domain being used with Droplr to from, and I am trying to setup a redirect with .htaccess to forward any requests to to

I currently have the following, but it doesn't seem to have any affect on the domain. Please can you tell me where I am going wrong?

RewriteEngine on
RewriteCond %{HTTP_HOST} ^$ [OR]
RewriteCond %{HTTP_HOST} ^$
RewriteRule ^(.*)$$1 [R=301,L]
share|improve this question
It might be because its saturday and I haven't had coffee, but this question makes no sense (among other things, is by definition a subdomain of I think you may just have your terminology tied up in a marvelous knot (confused between subdomain and virtual host?) -- can you clarify a little bit? – voretaq7 Nov 10 '12 at 19:06
@voretaq7 Does that make a bit more sense? – max_ Nov 10 '12 at 19:08
Yes, much more :-) And Kamil's answer below is the easiest solution (avoid the headache of mod_rewrite entirely wherever possible :-) -- If you want to do it with rewrite rules you can, its just more work -- this question can point you in the right direction – voretaq7 Nov 10 '12 at 19:12
@voretaq7 I think that htaccess is actually the only way as I'm on shared hosting... – max_ Nov 10 '12 at 19:19

Setup virtual domain with alias and inside the virtual server configuration do permanent redirect.

You don't need mod_rewrite, it's unnecessarily complicated and demanding.

In case you have "wildcard" hosting for entire * you can use following rules to normalize your URIs:

RewriteEngine on
RewriteCond %{HTTP_HOST} [OR]
RewriteCond %{HTTP_HOST}
RewriteRule ^(.*)$$1 [R=permanent,L]
share|improve this answer
I don't have access to setting up a virtual domain as I'm on shared hosting – max_ Nov 10 '12 at 19:19
If you're on shared hosting you're probably better off talking to your provider - they may have other restrictions in place that would cause you trouble... – voretaq7 Nov 10 '12 at 19:21
Hmm, that's a good point. Is there any other way in which I could do this without having to go through virtual domains? – max_ Nov 10 '12 at 19:23
@iBeProgrammer and are you sure, the request ends in your current hosting? If so, see my edited answer – Kamil Šrot Nov 10 '12 at 19:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.