Shopify App proxy redirect to server url laravel

Shopify App proxy redirect to server url laravel

Navdeep_Garg
Visitor
3 0 0

Hello,

I am working on Shopify Private app in the Laravel framework. In this app, I am using the Shopify app proxy concept. I have created a custom page in the app which I want the show to the customer. I have added a custom app page link in the Shopify app proxy URL. Everything is working fine except one thing that is proxy URL.

Whenever I have tried to open my app proxy URL by a direct hit in the browser then it will redirect me to my app server's URL. I have to debug this issue but didn't find any solution. Here's the example of my issue for more clarification:-
Example:-
My App custom page URL is https://testserver.in/secure


My App proxy URL is https://teststore.myshopify.com/a/secure


When directly hit above link in the browser then it will redirect me to below link:-


https://testserver.in/secure?shop=teststore.myshopify.com&path_prefix=%2Fa%2Fsecure&timestamp=155928...

 

I have searched regarding this and most of the search results said that this issue comes in the Laravel framework and my app is also in the Laravel framework. Please help me with this. 

 

Thanks,

Replies 8 (8)

oscprofessional
Shopify Partner
16115 2409 3121

You would need to create a route by name "secure" in web.php and call controller and return view.

Get pass your Store Core Web Vital Free Speed Optimization Audit, Chat on WhatsApp | Skype : oscprofessionals-87 | Email: pallavi@oscprofessionals.com | Hire us | Guaranteed Site Speed Optimization | Website Free Audit | Shopify Theme Customization | Build Shopify Private App | Shopify SEO | Digital Marketing | Oscp Upsell & Cross sell App : Free | Oscp Sales & Volume Discount App : Free | Custom Pricing Wholesale App : Free
Navdeep_Garg
Visitor
3 0 0

Thanks for the reply. I have already added a route in web.php and also create a function in the controller from where I call the view file. For more details, Check Screenshots.

 

ss1.png

 

ss.png

 

Mcklen
New Member
12 0 0
Hi man.
Did you solve it?
Mcklen
New Member
12 0 0

I have this problem too.

skillmatic
Shopify Partner
53 0 7

@Navdeep_Garg Did you figure this out? I'm having the same issue.

umairakram
Shopify Partner
17 1 6

Hi @Navdeep_Garg 

if you solved this problem, please help me. I'm facing the same problem.

thanks in advance

umairakram
Shopify Partner
17 1 6

I have fixed it. 

just remove the following line of code from public/.htaccess

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
evrenior
Shopify Partner
3 0 1

Thank you for this posting. That redirect is comming in Laravel package default installation and if you run apache, since .htaccess is used by apache(httpd) only. Now that I've removed 301 redirect from this file, it's working great and I'm getting just one POST call from App proxy instead of 3 calls with redirects before.

 

Thank you for help.