Elxis CMS Forum

Support => Technical support => Topic started by: jimmyz on March 02, 2011, 02:05:08

Title: Redirection from subdomain to domain
Post by: jimmyz on March 02, 2011, 02:05:08
Hi guys, hope you 're alright.
I need some help here. I have just moved my site from mysite.adomain.com to mysite.com. But, other friendly sites have made in the past links to my [old]site, in form of mysite.adomain.com/something/somewhere. Now, when a visitor clicks that link, gets redirected to my / of mysite.com. To do this, I have used <meta http-equiv="REFRESH" content="0;url=http://mysite.com"> in my<HEAD> tags, of a page named index.html in the place where my [old]site was. In addition, I have in the same [old]location a .htaccess, which includes ErrorDocument 404 /index.html.
What should I instruct mysite.adomain.com, to redirect people to the same location as before, but in my new host? What I mean is, clicking on mysite.adomain.com/something/somewhere, redirect to mysite.com/something/somewhere.
Any help is appreciated.
Title: Re: Redirection from subdomain to domain
Post by: Ivan Trebješanin on March 02, 2011, 09:31:46
You must create simple 301 redirection.

Please, check here: http://www.somacon.com/p145.php
Title: Re: Redirection from subdomain to domain
Post by: jimmyz on March 03, 2011, 17:18:52
Thank you for your direct response, Ivan.

It seems that all I needed was:

Code: [Select]
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://mysite.com/$1 [R=301,L]
in my .htaccess

My Best wishes.
Title: Re: Redirection from subdomain to domain
Post by: jimmyz on March 03, 2011, 17:26:23
A nice tool to view HTTP Request and Response Headers, is this (http://web-sniffer.net/)
and some more info for anyone interested may be here (http://www.stepforth.com/resources/web-marketing-knowledgebase/how-to-redirect-an-old-domain-to-a-new-domain/).