I'm trying to redirect www.olddomain.com/content/path to www.newdomain.com/content/path
Somehow:
.htaccess 301 redirect path and all child-paths
RewriteEngine On
RewriteRule ^(.*)$ http://newdomain.com/ [R=301]
Isn't working and is always redirecting to index.
Thanks!
Because you're missing captured group $1
in target URL:
RewriteEngine On
RewriteRule ^(.*)$ http://newdomain.com/$1 [L,R=301]
OR you can do:
RewriteEngine On
RewriteRule ^ http://newdomain.com%{REQUEST_URI} [L,R=301]
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