• Hi all,

    I’m hoping you guys to can help…

    I’m trying to update the .htaccess file so my site redirects from https://website.com.au to https://www.website.com.au. Here’s my current htaccess file:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    Any suggestions?

    Thanks for your time,
    Dan.

Viewing 1 replies (of 1 total)
  • If you include the “www” in the WordPress Address and Site Address in Settings -> General Settings, website.com.au will redirect to https://www.website.com.au automatically without changing your .htaccess, I believe.

    So you would log into the admin of your WordPress site and go Settings -> General Settings, then make sure WordPress Address and Site Address are both set to:
    https://www.website.com.au

    If you still want to do it with .htaccess, you’d do something like this:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]

Viewing 1 replies (of 1 total)
  • The topic ‘How To Update .htaccess file’ is closed to new replies.