Setting up a 301 .htaccess redirect

This article refers to a previous version of the Duda Responsive Website Builder. Click here for help content on the current Duda editor.

Overview

Some domain hosts do not allow you to create a 301 redirect by default. This means that their default configuration does not support DudaOne sites. It is possible, however, to get around this by setting up a 301 redirect in your host's .htaccess file. This will allow you to keep using that host, but you will need to keep your existing web hosting account for it to work.

Getting to your .htaccess file

Each domain host will have a different way of accessing your .htaccess file (though it's important to note that domain hosts or registrars who do not offer website hosting will not support this redirection method), but in general your .htaccess should be in the base (www or public_html) folder of your website. It's often hidden, so you may have to search for it or otherwise contact your hosting provider to help locate it.

Modifying your .htaccess file

Before modifying your .htaccess file, we recommend making a backup; changing a .htaccess file can permanently take your site offline, so having a backup is very useful in case something goes wrong. Once you've made a backup, replace the contents of your .htaccess file with the following line:


RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]

Be sure to replace the !example.com$ on line 3 with the base URL of your domain ( !yourdomain.com$, for example) and the http://www.example.com$1 with your www domain ( http://www.yourdomain.com$1 , for example).

Some web hosts may also include specific directions for modifying your .htaccess file; these are very important to pay attention to, as they can affect the way your .htaccess is read and cause this code not to work (or to work in an unexpected way!).

Once you've changed your .htaccess file, simply save it and your redirect should be complete. You may need to clear your phone's cache (or, depending on server configuration, your webhosting server's cache) to see the results.

×

Priority Phone Support

English phone support is available 18 hours a day,
Monday through Friday, 3am to 9pm (EST).

United States +1 866-776-1550 3am to 9pm (Eastern)
United Kingdom +44 (0)800-011-9071 8am to 2am (London)
France +33 (0)9-75-18-84-74 9am to 3am (Paris)
Israel +972 (0)3-720-8922 10am to 4am (Jerusalem)
Australia +61 (0)2-8880-9166 7pm to 1pm (Sydney)
To schedule a call in French, Portuguese, Hebrew or Russian, please email us at prioritysupport@dudamobile.com
×

Please Log in as a DudaPro

Priority Phone Support is available exclusively to DudaPros. Log in to your DudaPro account now to see our international support numbers.

Log In
Not a DudaPro? Start a free trial now!