If You wish to redirect Your website from http://www.example.com to http://example.com in DirectAdmin (or any other panel), follow below steps:
- In Your /domains/example.com/public_html directory create a file named .htaccess
- Paste below code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] - Save and upload to Your server.
- If file .htaccess already exist, then check if it contain line:
RewriteEngine on - If no, then paste above code on top of the file.
- If yes, then replace line “RewriteEngine on” with above code.
- 0 Users Found This Useful