Forums

WWW redirect (3 posts)

  1. Ed Crook
    Member
    Posted 2 years ago #

    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 (.*) http://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?

  2. maximum_g
    Member
    Posted 2 years ago #

    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 (.*) http://www.mydomain.com/$1 [R=301]
  3. ryans149
    Member
    Posted 2 years ago #

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

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

Topic Closed

This topic has been closed to new replies.

About this Topic