skip to Main Content

Whenever I send a request to my server App proxy sends it to Shopify store for no reason.

My Proxy URL: https://example.com/test/public/action

But I get this request returned from Ajax

GET
https://apiahmadztest.myshopify.com/action?shop=apiahmadztest.myshopify.com&path_prefix=%2Fapps%2Ffilter&timestamp=155579128&signature=9ceb23e244545faf5ad65f36b1196e6cfba57c9088a7d7dde96978970d
404 (Not Found)

Why it didn’t send it to the proxy URL I defined? Am I doing something wrong or its a bug?

2

Answers


  1. Chosen as BEST ANSWER

    I found the cause of the problem and it consists from two parts

    1- there's a problem with laravel when using Shopify proxy it always return mixed content error

    2- you can't use https, you have to start the Proxy URL with http or it will return page not found error

    anyway all you have is to make a php file like index and make it as your templet file to display something in Shopify.

    Once I find a solution to laravel I will edit this post.


    I found solution for laravel it because of the trailing slash at the end so it redirect the request if the url not a folder to solve this issue

    remove these two lines from .htaccess in public folder

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)/$ /$1 [L,R=301]
    

  2. You have to add the complete route. You can choose a prefix in the Shopify partner dashboard and also a sub path.

    The prefixes could be:

    • a
    • tools
    • community
    • apps

    So if for example you choose the tools prefix and “mysubpath” sub path, your route should be something like this: https://apiahmadztest.myshopify.com/tools/mysubpath/action?…

    You can find more information in the documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search