News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[HELP] Wap/Mobile Site as a new Subdomain

Started by schneizel57, December 31, 2012, 11:58:25 PM

Previous topic - Next topic

schneizel57

Hello. :)
Here's the situation:
My main website can be access at www.mysite.com
My SMF forum can be access at this subdomain www.forum.mysite.com
And What I want is, I like to access the wap/mobile site of my SMF forum directly at this new subdomain www.m.forum.mysite.com, whenever a user is detected using mobile device....

Is this even possible? If yes, how to do it?

Thanks! :D

Arantor

Possible but an awful lot of work because it's just not how SMF is designed to work (crossing subdomains like that), as it would require rewriting the way links are rewritten to include ;wap etc. which is not a small task.

schneizel57

Aw.... I'm not a good coder so this is just a dream now.
Ahm, ok. How can I configure my smf forum's default wap/mobile site? Is there any specific files that I need to edit?

Hj Ahmad Rasyid Hj Ismail

Can't you simply redirect your subdomain to http://yourforum/index.php?wap2 ?

For a mod to detect mobile device do search the mod site.

schneizel57

My forum's wap/mobile site is working. The thing is I want to customize the way it looks because it's almost just plain white. What files do I need to edit?

Hj Ahmad Rasyid Hj Ismail


Jade Elizabeth

Man it would be so awesome if you didn't have to redirect!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.


Jade Elizabeth

Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Antechinus

Just told ya. :D

Quote from: MSNAntechinus teh Awesomesauce says (6:10 PM)
Hey
saw your post
I rewrote the 1.1.x browser detection thingy to give an "is_touchscreen" context
then included a mobile mode in a responsive theme
much better than redirection to a mobile site (IMHO)

Jade Elizabeth says (6:11 PM)
you mean redirection from a mobile site?

Antechinus teh Awesomesauce says (6:11 PM)
well instead of having a mobile site and a normal site
I have one theme that does both
it swaps markup and css depending on whether the is_touchscreen context is called
auto detection for guests
overridden by profile setting for logged members

It's still a bit WIP, but it works.

Hj Ahmad Rasyid Hj Ismail

Nice work. Where can we follow this WIP of yours?

By the way, the OP say he wants to view the site from his subdomain and I can't think of any better way, lol. ;)

Antechinus

I think he only wants to use a subdomain because he thinks he needs a completely separate mobile site.

pkrack

NO, There is no need of a separate mobile sub domain. It all can be done with a 2 or 3 lines .htaccess rule. The only requirements is that if your host allow you to manage subdomains via .htaccess becasuse some hosts will show the content of sub folder say folder m for m.yourdoamin.com so first check that and than let us know

Jade Elizabeth

If you have a solution show us how. Don't say a few lines in .htaccess, tell us what to add :).
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Arantor

Except that a redirect doesn't solve the fact that *every single link on the site* won't reference the subdomain.

Hj Ahmad Rasyid Hj Ismail

Quote from: schneizel57 on December 31, 2012, 11:58:25 PM
And What I want is, I like to access the wap/mobile site of my SMF forum directly at this new subdomain www.m.forum.mysite.com, whenever a user is detected using mobile device....

Is this even possible? If yes, how to do it?
I quote this part of OP to explain my understanding.

1st, detect mobile device.
2nd, if detected, goes to this subdomain.
3rd, this subdomain access wap/mobile site.

So I thought if he just want the third want, he can simply set the subdomain to redirect to the forum wap/mobile site. This can simply be done in cPanel. And may be a mod from mod site can help achieve the first two.

But after checking the mod site emanuale Mobile Device Detect mod or Fabius85 SMF4iPhone mod (this may no longer be supported) is good enough to do the first and directly select a theme without having to go for the hassle of 2nd and 3rd.

Arantor

And that still doesn't make the slightest bit of difference. Every single URL in every single page will still NOT REFERENCE THE SUBDOMAIN.

Every page has the *full URL in it*. Go look at the source, you'll see that the entire URL including domain is in every page. Which means the redirect will only work THE FIRST TIME because after that the redirect never gets invoked.

Hj Ahmad Rasyid Hj Ismail

What do you mean Arantor as I could not make sense out of it (lack of my understanding of course ;) )?

If I am to redirect http://m.simplemachines.org to http://www.simplemachines.org/community/index.php?wap2, I can no longer open any link without their end is having ;wap2. So it will still be in the mobile mode except for Go to full version.

Arantor

If you redirect m.domain.com to domain.com/index.php?wap2 every single link has ?wap2 in it. But NONE of them are in m.domain.com any more.

So the m.domain.com is only any use for the first time anyone visits the page, it won't do anything else anywhere else.

Hj Ahmad Rasyid Hj Ismail

Yes. That is what I understand by redirect. As he worded he wants to access directly by that subdomain but not keep it under that subdomain.

But if he wants it to stay under that subdomain is also possible IMO.

Advertisement: