Viewing 2 replies - 1 through 2 (of 2 total)
  • Maybe try this in htaccess before your wordpress stuff or google “force www htaccess” there are different ways to write these lines.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
    RewriteRule .? https://www.example.com%{REQUEST_URI} [R=301,L]\

    @dralezero — the 3 lines you suggested worked perfectly for me with one exception. My wp-admin site was no longer accessible, as the redirect prevented me from getting to example.com/wp-admin/.

    Is there a way to exclude the wp-admin site from the redirect? Or can I access the admin site from https://www.example.com/wp-admin somehow?

    Thanks,
    Jon

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘www redirect subdirectory’ is closed to new replies.