Welcome, Guest
Username Password: Remember me

Non Detection - Subdomain Selection
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Non Detection - Subdomain Selection

Non Detection - Subdomain Selection 14 years, 9 months ago #162

  • SJamieson
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
I was looking for a way to redirect based purely on subdomain (a'la www/m/touch/x .facebook.com)
I eventually solved it by editing one of the method files - Originally checkmobile_dont_check.php but when this didn't work (is this PHP file depreciated now?) I successfully added it to checkmobile_always_iphone.php

My simplistic code is:
function CheckMobile()
{
$domain = $_SERVER['HTTP_HOST'];
switch($domain) {
case "m.yourdomain.com": return 'xhtml';
case "touch.yourdomain.com": return 'iphone';
case "wap.yourdomain.com": return 'wml';
case "imode.yourdomain.com": return 'html';
case "www.yourdomain.com": return 'html';
default: return 'html';
/* etc etc.... */
}
}

But a nice feature would be to have this kind of setting manageable from the admin control panel.

Non Detection - Subdomain Selection 14 years, 9 months ago #1385

  • jarkko
  • OFFLINE
  • Expert Boarder
  • Posts: 117
  • Karma: 0
Hi,

From what I understood is that you want for example iphone.yourdomain.com to show the iPhone page? If you set User Agent checking method to "No", enable "iPhone/iPod Domain" domain from the domain field and enter iphone.yourdomain.com you should see the iPhone version.

Non Detection - Subdomain Selection 14 years, 9 months ago #1393

  • SJamieson
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
Setting User Agent Checking to No with all domains activated sent everyone to the html content whether you went to the xhtml subdomain or iphone subdomain or wap subdomain. This is confirmed in checkmobile_dont_check.php where it returns only 'html' and doesn't check the subdomain against anything. My code is a basic version of the checking code that should be in checkmobile_dont_check.php to return the correct content .
I did have some other errors related to "Search Engine Friendly URL's" being on - which I've fixed since I posted, so I'm willing to have a play and see if this fixes it but I'm sure setting checking to no will still return html only.

Non Detection - Subdomain Selection 14 years, 9 months ago #1403

  • jarkko
  • OFFLINE
  • Expert Boarder
  • Posts: 117
  • Karma: 0
What did you set in the domain field?

Non Detection - Subdomain Selection 14 years, 9 months ago #1415

  • SJamieson
  • OFFLINE
  • Fresh Boarder
  • Posts: 3
  • Karma: 0
jarkko wrote:
What did you set in the domain field?


Apologies it seems I had a mistake in my subdomain names and it's working now I've corrected it. (looking at the code misdirected me into thinking it wasn't an included feature rather a mistake on my part)

Non Detection - Subdomain Selection 14 years, 8 months ago #1419

  • jarkko
  • OFFLINE
  • Expert Boarder
  • Posts: 117
  • Karma: 0
Alright. Glad you got it working.

Non Detection - Subdomain Selection 14 years, 8 months ago #1428

i still have issues with the subdomains. if i have subdomains on and someone goes to 'show standard version' from their iphone they just get a 404 error.
The URL I get directed to is: iphone.site.org/component/mobilejoomla/?task=setmarkup&markup=&return=

Actually this seems to happen with subdomains off as well.

I have SEF "YES", Apache Mod "YES" and Add suffix to URL "NO"

How do I know if I am on Apache and should rename my htaccess file as it instructs?
I am on GoDaddy.
  • Page:
  • 1
Time to create page: 0.10 seconds

By continuing to use this site you consent to the use of cookies on your device as described in our cookie policy unless you have disabled them. This site will not function correctly without cookies.

I accept cookies from this site.