• Resolved orangemint123

    (@orangemint123)


    Hi, I’ve searched a lot for this but can’t find the solution.
    I have a domain for mccartney-maxwell.co.uk, .net and .com and want to use the .com as the default address.

    Here is what my htaccess looks like atm but it doesn’t work for any pages other than the homepage. e.g. if I navigate to mccartney-maxwell.co.uk/job-opportunities it doesn’t change to .com

    # 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
    
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(www\.)?mccartney-maxwell\.com$ [NC]
    RewriteRule ^(.*) https://www.mccartney-maxwell.com/$1 [R=301,NE,L]

    Can anyone suggest what’s wrong please?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    That ought to work but just one thing: put this part on top of the file.

    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^(www\.)?mccartney-maxwell\.com$ [NC]
    RewriteRule ^(.*) https://www.mccartney-maxwell.com/$1 [R=301,NE,L]

    Then that should do it.

    Thread Starter orangemint123

    (@orangemint123)

    Sorted thanks ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘htaccess 301 redirect for .net and .co.uk to .com for all pages’ is closed to new replies.