0
votes

We got site written on Drupal.

We want to make Nginx caching but there is one problem we met.

Nginx caching works perfect, but if user A will go to page http://domain.com and nginx cache it. User B use mobile theme http://domain.com/?theme=mobile and went to http://domain.com/ , he will see desktop version instead of mobile version.

I want to make something like http://domain.com/any/url/path for desktop version and http://domain.com/mobile/any/url/path

Is it possible? Where can I found information about how to do it?

2

2 Answers

0
votes

There is this module named Mobile Switch to automatically switch between themes depending on the device used to visit the website : https://www.drupal.org/project/mobile_switch

0
votes

It was easily than I expect.

We use ThemeKey module so I added some rules depends on url like "drupal:path visuallimpaired/%" and just make my own plugin that use hook_url_inbound_alter and hook_url_outbound_alter to add and remove prefixes, and it works.