简体   繁体   中英

301 Redirect doesn't work

To start, I know this is liked the nth time this has been asked here, but I've looked and tried the answers to the other posts and they didn't work.

Anyway, I'm trying to redirect all out pages from the old domain to the new one with the same address (olddomain.com/this-page will go to newdomain.com/this-page). This seemed to be the best one to work:

RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 

While that redirects olddomain.com to newdomain.com, the subdirectories, other pages, etc doesnt seem to work. When I type in the URL, I see the status change at the bottom say "Waiting for newdomain.com", but it still loads the page from olddomain.com

So I really would appreciate it if someone would tell me how to completely redirect all the pages from olddomain.com onto newdomain.com.

Thanks a lot in advance :)

RewriteCond %{HTTP_HOST} ^olddomain\.com$ [NC]
RewriteRule ^(.*)$ http://newdomain.com/$1 [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