Redirect subdomain to subdomain on new domain
It would be helpful to specify how exactly is it not working. It seems to me that your code would redirect everything (including http://sio-india.org). This is because .* means "any character, zero or more repetitions", so sio-india.org would match too.
You should change your condition to
RewriteCond %{HTTP_HOST} ^(.*)\.sio-india\.org$ [NC]
RewriteRule ^(.*)$ http://%1.sio-india.com/$1 [R=301,L]
If that doesn't fix it - please be more specific about how it doesn't work.
Related videos on Youtube
Admin
Updated on September 17, 2022Comments
-
Admin over 1 year
I own 2 domains sio-india.org and sio-india.com
What i want to do is redirect all the subdomains from 1st domain to 2nd domain. eg. home.sio-india.org to home.sio-india.com but i dont want to redirect sio-india.org to sio-india.com and also dont want to redirect www.sio-india.org to www.sio-india.com
Please help
I am using this code in htaccess but it is not working.
RewriteCond %{HTTP_HOST} ^(.*)sio-india\.org$ [NC] RewriteRule ^(.*)$ http://%1sio-india.com/$1 [R=301,L]
Please hepl me I am stuck.
-
Lauri Lehtinen almost 14 yearsAre any redirects working? I.e. is the web server set up to respect rewrites defined in .htaccess?
-
-
Admin about 11 yearsThanks it works perfecttly! I am using it on one of my sites. Was looking for a very long time.