301 Redirects API

AnesMehovic99
Shopify Partner
4 0 0

Hi. I am currently working on an application that handles redirects on a store front. Right now the application only supports 404 redirects and I was thinking of adding 301 redirects as well. The only problem is that I do not know the logic behind the current API, meaning I do not know how to add functions on top of it so that it handles 301 redirects. If anyone has experience with this, what would be the process of doing this?

Replies 5 (5)

SBD_
Shopify Staff
1829 270 410

Hey @AnesMehovic99 

 

Can you elaborate on where you app sits? Does it run on a merchant's theme?

Scott | Developer Advocate @ Shopify 

AnesMehovic99
Shopify Partner
4 0 0

Hi @SBD_ 

Thanks for answering. The app is installed on the merchant's theme yes. It currently only allows 404 redirects and 404 redirects with a pattern. I won't get too much into detail, but my app's simple 404 redirect function only sends the user input data to the shopify's built in URL redirection. The 404 patterns work differently since it pastes a script on the merchant's liquid theme in order to make the custom 404 redirect work.

On top of these two features I would just like to add the ability to create 301 redirects.

SBD_
Shopify Staff
1829 270 410

Got you! Thanks for the details.

 

301 redirects are a little different since they run server-side. Depending on what you'd like to build, the Redirects API might be useful. Good luck!

Scott | Developer Advocate @ Shopify 

AnesMehovic99
Shopify Partner
4 0 0

Thanks for the reply.

I was wondering would it be possible to talk to you directly regarding this problem? Just so I can seek out advice. If not, thank you still for your time in answering my questions.

SBD_
Shopify Staff
1829 270 410

Feel free to DM 🙂

Scott | Developer Advocate @ Shopify