I need to redirect particular URLs on a subdomain to completely different URLs on a different subdomain. For example:
http://foo.example.com/this-is-my-page
Needs to 301
to:
http://bar.example.com/this-is-really-my-page
I’ve tried setting up a simple Redirect 301
in .htaccess
but it doesn't seem to work. For example:
Redirect 301 http://foo.example.com/this-is-my-page http://bar.example.com/this-is-really-my-page
Under Modify a Subdomain, locate the domain you want to redirect, then click its Manage Redirection link on the right. In the text box, type the URL you would like visitors to be redirected to if they go to the subdomain sample1.hgexample.com. Click Save. You will see the redirected URL under the Redirection column.
A 301 Permanent Redirect permanently redirects one URL to another. You set up a 301 redirect using . htaccess to send visitors to a new URL and tell search engines that a page has moved so that the new page can be properly indexed. Some common uses of a 301 redirect with .
try this:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^sub\.domain\.com$ [NC]
RewriteRule ^(.*) http://newsub.domain.com/ [L,R]
it works on my side
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With