• Hi,

    I realize WordPress handles the no-www -> www redirect and vice versa itself, but the problem I have is that it only redirects anything WordPress related (existing or no, ie existing posts or anything resulting in a 404 error). If I try to access an existing subdirectory (which I use for other things), they don’t redirect to www. and adding the usual fix in htaccess didn’t result in fixing it. I added:

    RewriteCond %(HTTP_HOST) ^mydomain.\tld
    RewriteRule (.*) https://www.mydomain.tld/$1 [R=301]

    I presume it’s related to WordPress and how it handles the redirection, so, how do I force it for everything on the server?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    I am actually also having a similar problems as i’m trying to redirect as site from .com.au to .com and the WordPress site appears to be ignoring both “Redirect” and “Rewrite”

    I would also like to know how to force the server to do a redirect via rewrite.

    RewriteCond %(HTTP_HOST) ^mydomain\.com\.au [NC]
    RewriteRule (.*) https://www.mydomain.com/$1 [R=301]

    you want to redirect a sub directory: for example domain.com/sub to https://www.domain.com/sub

    So you need to create the .htaccess file inside sub directory and then use the code in it…

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