Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

301 redirect help

Hi everyone, long time no speak, hope everyone is cool.

Quick help please if you don't mind. I have redirected a Shopify site to another (basically same URL paths just a domain change and design change to a more expensive looking one so can charge more money for the products). I used this 301 redirect to try and ensure that the old domain and inner pages get redirected to the new domain and relevant inner pages:

RewriteEngine on
RewriteCond %{HTTPS_HOST} ^oldsite\$ [NC]
RewriteRule ^(.*)$ https://newsite/$1 [R=301,L]

But all URLs just get redirected to the homepage of the - what is wrong with the code, I've asked around, looked at other sites I've done similar in the past and it works. What am I doing wrongly? I imagine it's a very simple mistake but I cannot see it.

Thanks in advance.



  • RewriteRule ^(.*)$ https://newsite/$1 [R=301,L]

  • Hey, buddy..haven't seen you on in a bit. Not like I have been, myself. : (

    Anyway, think u forgot a / after .uk
  • KaineKaine
    edited March 13
    Hi @JudderMan, I hope you're okay: 

    Test that:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^$
    RewriteRule ^(.*)$1 [R=301]
    Normally urls should be redirected. Why not does a permanent redirect ?
  • Hi everyone,

    Thanks but having tried both those solutions, I get this / causing a 404/unknown page.

    Is it HTTPS_Host or HTTP_Host? Just it's going from an https Shopify site to another, exactly the same structure, just the domain name is changed (rebrand).

    This is hurting my brain, it has to be a simple solution but I can't see it.

Sign In or Register to comment.