Non Detection - Subdomain Selection

SJamieson
14 years, 9 months ago
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.
jarkko
14 years, 9 months ago
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.
SJamieson
14 years, 9 months ago
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.
jarkko
14 years, 9 months ago
What did you set in the domain field?
SJamieson
14 years, 9 months ago
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)
jarkko
14 years, 9 months ago
Alright. Glad you got it working.
craig.reilly
14 years, 9 months ago
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.

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.