简体   繁体   中英

Redirect 301 htaccess old domain to new domain without copying equivalent urls

I'm trying to have a full domain 301 htaccess redirect without copying the urls, so I want to make if the old domain url is: rucab.net/auth , is redirect to www.residenciarucab.es (root domain), not redirecting to www.residenciarucab.es/auth (same equivalent url). The root old domain redirect good to the root new domain, but with the pages happens like I said before.

I tried with that but didn't work:

RewriteEngine on 
 RedirectMatch 301 ^/(.*)$ https://www.residenciarucab.es/$1

Check this rule on the top of your .htaccess file

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?rucab\.net [NC]
RewriteRule (.*) https://www.residenciarucab.es/ [R=301,L]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM