Forums

WWW redirect (3 posts)

  1. Ed Crook
    Member
    Posted 8 months 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 4 months 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 4 months ago #

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

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

Reply

You must log in to post.

About this Topic