• Hi

    I’ve migrated my website from domain.com to domain.co.uk and now I’m trying to figure out a way to redirect it properly, so

    domain.com –> domain.co.uk
    domain.com/some-article –> domain.co.uk/some-article

    The problem is I’m only managing to redirect everything to domain.co.uk, but not to specific articles.

    My .htaccess file looks like this now:

    # 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
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule (.*) https://www.domain.co.uk/$1 [R=301,L]

    Please, help ??

Viewing 1 replies (of 1 total)
  • 301 must be before wp block, try:

    Options +FollowSymLinks
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule (.*) https://www.domain.co.uk/$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

Viewing 1 replies (of 1 total)
  • The topic ‘301 redirect issue (only redirects homepage)’ is closed to new replies.