Proxying my shop to a subdirectory

New Member
3 0 0

Sorry if this is a double post, I'm really not sure what happened to my previous post.

Anyway, I have a site already running on Nginx that I'd like to add an e-commerce section to at www.example.com/store. I know how to do this from the server side, but I don't know how I would edit the base url for the shopify theme. Can you add a url with a subfolder to the domain list and just expect it to do the right thing? Or do I need to add a hook to the theme? Any advice would be appreciated.

0 Likes
Shopify Staff
Shopify Staff
75 0 18

Hey there Shane!

Wesley here with the shopify Guru team! What you are wanting to do can be done, but in a slightly different way. You are wanting to do www.example.com/store, which is acutally a subdirectory not a subdomain. A subdomain would be store.example.com. 

Subdomains can easily be pointed at your shopify store, you just need to set them up with your domain provider. We have a guide that I'll include below that walks you through how to add a subdomian with your domain provider.

https://docs.shopify.com/manual/domains/use-your-own-domain#set-up-your-subdomains

Stay awesome.

-Wesley

0 Likes
New Member
3 0 0

Gah, sorry, I mistyped when I had to repost this. I meant subdirectory. A subdomain is not at all acceptable. In any way. I can redirect the directory to the shop, no problem. I just need to change the base url in all of the frontend links. How do I get into {{ shop.url }} and change it?

0 Likes
Shopify Staff
Shopify Staff
75 0 18

{{ shop.url }} is pulling from what is set as the primary domain in Online store > Domains. The only way to change that is to add a new domain do your shop and that has to be either a root domain or a subdomain.

0 Likes
Excursionist
32 0 3

Hi Wesley,

 

so basically you cannot run one store off of mysite.com/pl and another store off of mysite.com ?

 

Right... ?

 

Cheers, Tom

0 Likes