rewriteEngine on
rewriteRule ^(.*)$ http://www.newdomain.com/$1 [R=301,L]
This is a super easy snippet to redirect entire website to different url by following steps.
1) Create .htaccess file in your root folder. (If .htaccess file is already created, edit the file.)
2) Now paste the code and replace 'www.newdomain.com' with the domain where you want to redirect.
3) Save, That's it.
This will redirect "www.yourdomain.com" to "www.newdomain.com".
1) Create .htaccess file in your root folder. (If .htaccess file is already created, edit the file.)
2) Now paste the code and replace 'www.newdomain.com' with the domain where you want to redirect.
3) Save, That's it.
This will redirect "www.yourdomain.com" to "www.newdomain.com".
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.