• Hi, I have been fighting whole day with this and no luck so far.
    Well, my IP do not redirect to my domain name, no matter what I do.

    My .htaccess file:

    <IfModule mod_rewrite.c>
    
    RewriteEngine On
    RewriteBase /
        RewriteCond %{HTTP_USER_AGENT} libwww-perl.*
        RewriteRule .* ? [F,L]
    
        #IP Canonical
        RewriteCond %{HTTP_HOST} ^111\.111\.111\.111
        RewriteRule (.*) https://www.my-tdomain.com/$1 [R=301,L]
    
        #Non-www to www
        RewriteCond %{HTTP_HOST} ^my-domain\.com
        RewriteRule (.*) https://www.my-domain.com/$1 [R=301,L]
    
    </IfModule>
    
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    ExpiresActive on
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"

    I have tried thousands different .htaccess codes with no luck. Do I really miss something or why this happens?

    I’m wasn’t able to redirect non-www to www with .htaccess. I did it actually in WordPress dashboard Setting -> General and I changed the urls to www versions. After that non-www redirected to www.

    But anyway, I’m still stuck with IP redirection.

    Any suggestions?
    Thank you!

Viewing 1 replies (of 1 total)
  • Thread Starter ballin-

    (@ballin-2)

    Anyone?
    Seems like non-www do not redirect to www version, at least Google Analytics says so. Sounds like this issue is not caused in my end.

Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess IP canonical issue’ is closed to new replies.