0

Actually I have two sources

  1. Desktop Layout Support (/Public_html/Desktop) (example.com)

  2. Mobile Layout support (/Public_html/Mobile) (example.com)

How can i link root path based on device access without chnage/redirect domain in .htaccess.

Actually i Have tried

RewriteEngine on
RewriteCond %{HTTP_HOST} ^sample.in$ [NC,OR]
RewriteCond %{HTTP_HOST} ^sample.in$
RewriteCond %{REQUEST_URI} !Public_html/Desktop/
RewriteRule (.*) /Public_html/Desktop/$1 [L]

But i can't able to find device

Please help me to solve my problem.

Dinesh G
  • 1,045
  • 3
  • 13
  • 23

1 Answers1

1

My suggestion here that you can try to create loader.php located in /Public_html/loader.php set it as root in .htaccess and when request comes to loader.php detect device for example by method suggested here - Simplest way to detect a mobile device after detection you have 2 options to do

1) Easy option: redirect page to example.com/desctop or to example.com/mobile

2) Hard option: include nigher /Public_html/Desktop/index.php nigher /Public_html/Mobile/index.php which for sure requires a lot additional configuration of include pats in your both projects

Community
  • 1
  • 1
Armen
  • 3,758
  • 1
  • 18
  • 38