Recently we changed the name of a subdomain, now we need to redirect all the old pages to the new subdomain pages.
Example page links:
Old URL: http://jquery.webcodehelpers.com/2013/08/what-does-dollar-sign-means-in-jquery.html
New URL: http://uieiq.webcodehelpers.com/2013/08/what-does-dollar-sign-means-in-jquery.html
My findings: when I try to access the subdomain in the top level it is working good.
How can I redirect all URLs on the old subdomain to the new subdomain?
currently i have the below code in .htaccess file , please guide to solve the problem
RewriteEngine on
RewriteCond %{HTTP_HOST} ^jquery\.webcodehelpers\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.jquery\.webcodehelpers\.com$
RewriteRule ^/?$ "http\:\/\/uieiq\.webcodehelpers\.com\/search\/label\/jquery\ interview\ questions" [R=301,L]
Enable
mod_rewrite
and.htaccess
throughhttpd.conf
and then put this code in yourDOCUMENT_ROOT/.htaccess
file:Please read: Apache mod_rewrite Introduction
This worked for me, and maintains the URI:
I used this to redirect a subdomain to another subdomain.