An open source eCommerce platform giving you full control and customizability. Modular and API-first. Build any eCommerce solution that your business requires. Developed by @vendo-dev
We want to deploy spree to www.example.com/myshop/
We can reach the homepage, but none of the links we click work.
Context
Whenever we click a link, e.g. 'shop now' link, we are redirected to www.example.com/products instead of www.example.com/myshop/products.
Whenever we go to www.example.com/myshop/admin, we get redirected to www.example.com/login
myshop path prefix gets lost
Expected Behavior
Spree generates URLs prefixed with /myshop/ in all its links and buttons.
Actual Behavior
Spree does not know it's deployed in a subfolder and so generates links like /products instead of /myshop/products.
Possible Fix
Spree should adhere to config.relative_url_root and config.action_controller.relative_url_root or we should be able to set a prefix that Spree adheres to. We've searched the docs
We've set config.action_controller.relative_url_root = '/myshop', we've set config.relative_url_root = '/myshop', we've followed Tim Lentse's blog post
Changing the route to mount Spree::Core::Engine, at: '/myshop' (or to at: '/myshop/') crashes with `ActionController::RoutingError (No route matches [GET] "/");
Your Environment
Version used:
4.1.1
Gemfile and Gemfile.lock as text in a Gist:
Create new rails project and added:
We want to deploy spree to www.example.com/myshop/ We can reach the homepage, but none of the links we click work.
Context
Whenever we click a link, e.g. 'shop now' link, we are redirected to www.example.com/products instead of www.example.com/myshop/products. Whenever we go to www.example.com/myshop/admin, we get redirected to www.example.com/login
myshop
path prefix gets lostExpected Behavior
Spree generates URLs prefixed with
/myshop/
in all its links and buttons.Actual Behavior
Spree does not know it's deployed in a subfolder and so generates links like
/products
instead of/myshop/products
.Possible Fix
Spree should adhere to
config.relative_url_root
andconfig.action_controller.relative_url_root
or we should be able to set a prefix that Spree adheres to. We've searched the docsSteps to Reproduce
myshop
alias to thepath/to/myshop
config.action_controller.relative_url_root = '/myshop'
, we've setconfig.relative_url_root = '/myshop'
, we've followed Tim Lentse's blog postmount Spree::Core::Engine, at: '/myshop'
(or toat: '/myshop/'
) crashes with `ActionController::RoutingError (No route matches [GET] "/");Your Environment
Version used: 4.1.1
Gemfile and Gemfile.lock as text in a Gist: Create new rails project and added: