All my full site pages are under folder public_html, which contains index.php and folder m which contains all the mobile site pages. index.php is like this:
<?php
if (...mobile client) {
header('Location: m/');
} else {
include 'front.html.php';
}
?>
There is also an index.php in m, simply `include ‘front.html’.
This script can detect user’s client and direct to full site and mobile site automatically.
But now I want a link on the mobile site to switch to full site. If it is like <a href="../front.html.php">switch to full site</a>, there will be front.html.php in the address bar, and I don’t want this. However, if it is like <a href="../">switch to full site</a>, it will detect again and back to mobile site.
How to deal with that?
You can accomplish this by setting a cookie.
Then from that php script, redirect to the home page.
In your index.php, check the cookie: