Mobile app version of vmapp.org
Login or Join
LarsenBagley505

: Proper syntax for .htaccess Rewrite I'm very new at this so apologies if this is too easy, but would this be proper syntax for redirecting an entire site to a new domain? This is what was

@LarsenBagley505

Posted in: #301Redirect #ModRewrite

I'm very new at this so apologies if this is too easy, but would this be proper syntax for redirecting an entire site to a new domain? This is what was suggested so my other concern is blank lines, spaces, etc. Thanks

RewriteEngine On

# Redirect Entire Site to New Domain
RewriteCond %{HTTP_HOST} ^oldsite.org$ [NC]
RewriteRule ^(.*)$ newsite.com/ [R=301,L]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @LarsenBagley505

1 Comments

Sorted by latest first Latest Oldest Best

 

@Harper822

Yes that's correct and would 301 redirect everything on oldsite.org to the same path on newsite.com. Plenty of similar questions on the StackExchange network such as this one.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme