How can I configure HTTP 301 redirection instead of 307?

mohamedhamid
Shopify Partner
2 0 0

Hi,

I would like to know how to configure HTTP redirection with code 301.

 

Currently, the redirection type is 307, which means when I navigated http://mysite.com,  I will be redirected to https//mysite.com with a code 307.

I would like to configure the redirection with code 301 which is more friendly to SEO.

In general, this can be handled at the .htaccess file, but in Shopify, that's not possible.

Anyone can help?
Thanks in advance.

Replies 2 (2)

NomtechSolution
Astronaut
1245 113 147

In Shopify, you cannot directly modify the .htaccess file to configure HTTP redirection. However, you can achieve a 301 redirection by using Shopify's built-in URL redirects feature. Here's how you can do it:

  1. In your Shopify admin, go to "Online Store" -> "Navigation".
  2. Scroll down to the "URL redirects" section and click on "Manage".
  3. Click on the "Add URL redirect" button.
  4. In the "Redirect from" field, enter the old URL that you want to redirect from (e.g., http://mysite.com).
  5. In the "Redirect to" field, enter the new URL that you want to redirect to (e.g., https://mysite.com).
  6. Set the "Redirect type" to "Permanent (301)".
  7. Click on the "Save" button to create the URL redirect.
mohamedhamid
Shopify Partner
2 0 0

Thanks for the help, but the idea you mentioned doesn't work in case I need to set the redirection for the homepage because Redirect from option only accepts subpages.
Screenshot 2023-05-30 at 15.13.44.png