mamesaye mamesaye - 24 days ago 6
Apache Configuration Question

htaccess 301 redirect subdomain to different domain

I want to redirect my subdomain to different subdomain on a different server. ->

I tried this on .htaccess unsuccessfully:

RewriteCond %{HTTP_HOST} ^$ [NC]
RewriteRule ^(.*)$$1 [R=301,L]

Where is the problem?

Answer Source

This should do the trick for you, just remove the '^'

  RewriteCond %{HTTP_HOST} ^$
  RewriteRule (.*)$$1 [R=301,L]