Forums

301 Redirect from .com.au to .com with.htaccess (5 posts)

  1. maximum_g
    Member
    Posted 2 years ago #

    Hi,

    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 have tried

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

    and

    Redirect 301 '/' http://www.mydomain.com

    But the commands in the htaccess file appear to have been ignored. Is there any way to force a server with a wordpress site to do redirect?

    Thanks for taking the time to read my post.

  2. ryans149
    Member
    Posted 2 years ago #

    RewriteCond %{HTTP_HOST} ^yourdomain.com.au$
    RewriteRule ^.*$ "http\:\/\/yourdomain\.com" [R=301,L]
  3. Pranav Rastogi
    Member
    Posted 2 years ago #

    If that's the case. Go to WP-admin -> Settings -> General and you should see the blog and WordPress field, just change them to whatever you like. :)

  4. Shane G
    Member
    Posted 2 years ago #

    Hi,

    Check with this code:

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain\.com$ [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]

    Thanks,

    Shane G.

  5. ryans149
    Member
    Posted 2 years ago #

    shane,

    Please check your code again. It is incorrect. It will redirect .com domain to again .com domain.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.