News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

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.

Arantor

It's all possible but correspondingly way more effort to implement.

Hj Ahmad Rasyid Hj Ismail

Not really. Especially when I suddenly remember what I have done while using and playing with feline PortaMX Subforum mod and htaccess few months back. Creating a copy of the main forum using that mod is very simple and with htaccess you can rewrite the subforum which is using the subdomain to have all its url ends with ;wap2.

Arantor

I give up trying to explain why you're missing the point

Dragooon

Can't you simply re-create index.php at m.domain.com and override board_url to follow m.domain.com under WAP mode? It'll require a bit more work than that but I think that should do it.

Hj Ahmad Rasyid Hj Ismail

Quote from: Arantor on January 01, 2013, 11:24:31 AM
I give up trying to explain why you're missing the point
Sorry, I am not sure which point that I missed.

Anyway, I think Dragoon way could be one of the easiest, if rewriting the said index.php is easy for the OP that is.  ::)

schneizel57

Is it really possible? Because I saw some smf forum sites that has mobile site in subdomain m.theirsite.com which can be access through mobile devices.

Hj Ahmad Rasyid Hj Ismail

Just wait for Dragoon for this. He might have a way to do it as he suggested.

Jade Elizabeth

I getcha. We want to access the mobile version so we go to m.blah.com and that redirects us to the mobile theme. Works for me!
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Hj Ahmad Rasyid Hj Ismail

This is another way of doing it: http://script-smart.com/resources/hide-affiliate-link/online-link-cloaker.php. Put your forum wap url (or mobile theme url) in it. If I am not mistaken (since I used it some time ago), you can create a index page, php or html, for your subdomain which actually displays the wap/mobile page in it.

pkrack

Quote from: Jade Elizabeth on January 01, 2013, 06:41:06 AM
If you have a solution show us how. Don't say a few lines in .htaccess, tell us what to add :).

//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
Rewriterule ^m.example.com$ www.example.com/index.php?wap2 [L]

pkrack

I have posted the code. Now those of you who consider themselves pro, come forward and give it some cuts and stitches. Together we can have an excellent end product

Hj Ahmad Rasyid Hj Ismail

You don't need to create and write htaccess file manually. You can create the subdomain redirect from cpanel.

pkrack


pkrack

Moreover, Cpanel Can only redirect one domain, while using .htaccess, we can have a completely different URL SCHEMA

Hj Ahmad Rasyid Hj Ismail

Quote from: pkrack on January 04, 2013, 07:25:42 AM
Moreover, Cpanel Can only redirect one domain, while using .htaccess, we can have a completely different URL SCHEMA
I am not sure about this because mine can do with subdomain.

Quote from: pkrack on January 04, 2013, 07:24:22 AM
Not Every User  use Cpanel
Yup. That is why we are putting all the options so that the OP can choose which he prefers.

pkrack

Quote from: ahrasis on January 04, 2013, 07:33:46 AM
I am not sure about this because mine can do with subdomain.


Offcourse subdomain can be redirected but not dynamic urls. Can Cpanel  redirects all your forum posts like m.domain.com/topic-discussed-bla-bla.html to domain.com/index.php?waps................? So cpanel is not the perfect solution.

Hj Ahmad Rasyid Hj Ismail

I rather think I was confused with the OP but what I understand is subdomain to wap url and not the dyanmic url to another dynamic url. Given that, I think cPanel can do that just fine. ;)

pkrack

Quote from: schneizel57 on December 31, 2012, 11:58:25 PM

My SMF forum can be access at this subdomain www.forum.mysite.com

Probably His posts are assisable via www.forum.mysite.com/some-post-thing-etc-etc

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....


So I think He will also like to have www.m.forum.mysqite.com to show posts as www.m.forum.mysqite.com/some-posts-etc-etc because I don't think just redirecting www.m.forum.mysqite.com to wap version and then just using www.forum.mysqite.com/index/?topic=123132;wap2 will make no sense coz smf automatically redirects mobile browsers to wap versions then for what purpose he will need  a sub subdomian

Jade Elizabeth

The subdomain is so you don't have to remember the url for the wap.
Once proud Documentation Writer and Help Squad Leader | Check out my new adult coloring career: Color With Jade/Patreon.

Hj Ahmad Rasyid Hj Ismail

Quote from: pkrack on January 06, 2013, 12:26:34 AM
Quote from: schneizel57 on December 31, 2012, 11:58:25 PM

My SMF forum can be access at this subdomain www.forum.mysite.com

Probably His posts are assisable via www.forum.mysite.com/some-post-thing-etc-etc

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....


So I think He will also like to have www.m.forum.mysqite.com to show posts as www.m.forum.mysqite.com/some-posts-etc-etc because I don't think just redirecting www.m.forum.mysqite.com to wap version and then just using www.forum.mysqite.com/index/?topic=123132;wap2 will make no sense coz smf automatically redirects mobile browsers to wap versions then for what purpose he will need  a sub subdomian
IMO you are now making too much assumptions to the extend it does not not help the OP at all.

And what's the big deal in writing htaccess manually as you suggested anyway? The htaccess code for url rewriting that you suggested is IMO nothing better or even more complete than creating it via cPanel. No offence but your solution in Reply #29 IMO will only work similar to cPanel solution already given in Reply #3 which IMO can be set in a much more easier and convenient way.

Otherwise, you are not making any sense except keep on making assumptions and pointless arguments, for no purpose except only for arguing it. This is not helping at all.

My conclusion is if one is really trying to keep the wap url with or inside the subdomain url, one can use suggestions in Reply #3 or #21 or #28 or 29. Reply #21 will be a bit confusing unless one is used to the PortaMX Subforum Mod. Reply #3 and #28 is much more easier and simpler. Reply #29 is similar to #3 except it is done manually.

However, I am not really sure how to make it work with reply #23 though I think it may work if properly coded and modified.

pkrack

My Solution is simple but if you kindly have a detailed look on my post then you will find that I have posted this code for others developers to make improvement to it and make it perfect by contributing. But I realized now that Either they don;t understand any thing or they just can't digest the solution from others :)

Advertisement: