htaccess snippets to redirect all pages to one page but none of them are working for me.
I need olddomain.com , olddomain.com/pricing , olddomain.com/about , etc all to point to newdomain.com.
So olddomain.com/pricing shout not go to new domain.com/pricing.
It should just go to newdomain.com.
How can I do this?
Nothing simpler then that.
If it are different webservers, you can write this on the old ones:
RewriteEngine On
RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L]
^(.*)$ means everythinghttp://www.newdomain.com is the targetIf it is still the same webserver
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(.*)newdomain.com$ [NC]
RewriteRule ^(.*)$ http://www.newdomain.com [L,R=301]
It is pretty the same, but you have the condition, that the host is not newdomain.com.
RedirectMatch 301 (?i)/* http://www.yourdomain.com/WHATEVER
or
RedirectMatch 301 (?i)/OLD/* http://www.yourdomain.com/WHATEVER
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