Shopify / shopify-app-template-php

278 stars 89 forks source link

When I hosted to cPanel the other routes are showing 404 #140

Open ibartsindia opened 2 years ago

ibartsindia commented 2 years ago

Issue summary

When I am attaching ?shop parameter it is redirecting to /login but showing 404

Expected behavior

It should ask to install the unlisted app and if app is installed then should redirect to store app page

Sanjay-100 commented 2 years ago

@ibartsindia have update the white list URL on Shopify app try to reisntall app or install app into new store. can you please share the web.php code snippets?

ibartsindia commented 2 years ago

Hello, Thanks for your reply

I am attaching my web.php file here.

On Fri, Apr 8, 2022 at 11:10 AM Sanjay-100 @.***> wrote:

@ibartsindia https://github.com/ibartsindia have update the white list URL on Shopify app try to reisntall app or install app into new store. can you please share the web.php code snippets?

— Reply to this email directly, view it on GitHub https://github.com/Shopify/shopify-app-php/issues/140#issuecomment-1092460857, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALQJIQAAVU4NEOERXBLCZQ3VD7BEXANCNFSM5R2UE7TA . You are receiving this because you were mentioned.Message ID: @.***>

Sanjay-100 commented 2 years ago

@ibartsindia I can't see the web.php file

ibartsindia commented 2 years ago

The file is attached.

Anyway I am providing you drive link too : https://drive.google.com/file/d/1btvQjtuHxw-e3VDRHDPpZWyaQp2PTIRI/view?usp=sharing

On Mon, Apr 11, 2022 at 10:41 AM Sanjay-100 @.***> wrote:

@ibartsindia https://github.com/ibartsindia I can't see the web.php file

— Reply to this email directly, view it on GitHub https://github.com/Shopify/shopify-app-php/issues/140#issuecomment-1094558165, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALQJIQE43G5EZ7BDAQUG6QLVEOX65ANCNFSM5R2UE7TA . You are receiving this because you were mentioned.Message ID: @.***>

MagicLegend commented 2 years ago

It's expecting /?shop=example.com added to the request. But then I ran into SQL failures. This project could use some docs on how to actually get it running...

macorredor commented 2 years ago

Hi there, Is there any update on this bug? I have also hosted the app on cPanel within a subdomain. And URLs starting with /api don't work correctly. Thanks.

MaximilianMauroner426 commented 2 years ago

I got that working by copying the .htaccess in the public dir from the laravel github and adding the host in the .env file

Hi there, Is there any update on this bug? I have also hosted the app on cPanel within a subdomain. And URLs starting with /api don't work correctly. Thanks.

JoshHighland commented 1 year ago

Same thing for me. I had to copy the .htaccess file from the laravel repo.

I got that working by copying the .htaccess in the public dir from the laravel github and adding the host in the .env file

Hi there, Is there any update on this bug? I have also hosted the app on cPanel within a subdomain. And URLs starting with /api don't work correctly. Thanks.

moshiurse commented 1 year ago

I had this issue when I deploy my web folder to production. We need to add an .htaccess file to the root folder. To redirect to public/index.php by default we need to write some code.

 <IfModule mod_rewrite.c>
 <IfModule mod_negotiation.c>
     Options -MultiViews
 </IfModule>

 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} -d [OR]
 RewriteCond %{REQUEST_FILENAME} -f
 RewriteRule ^ ^$1 [N]

 RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
 RewriteRule ^(.*)$ public/$1

 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ server.php

 RewriteCond %{HTTP:Authorization} ^(.*)
 RewriteRule .* - [e=HTTP_AUTHORIZATION:%1]
 </IfModule>

Inside public folder add another .htaccess with following content

RewriteEngine on
RewriteCond $1 !^(index.php|resources|robots.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]