Redirect Website to a Different URL using .htaccess

rewriteEngine on rewriteRule ^(.*)$$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 '' with the domain where you want to redirect.
3) Save, That's it.

This will redirect "" to "".

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.