Welcome, Guest
Username Password: Remember me

simple .htaccess solution?
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: simple .htaccess solution?

simple .htaccess solution? 12 years, 2 months ago #11568

I found a simple .htaccess solution that drives all mobile devices from mysite.com to m.mysite.com. What I like about this code is that it works great at www.mobilephoneemulator.com/

The problem is the "View Main Website" link on the mobile menu does not work. It loops back to the mobile site.

Site: bluemooncafe.us (mobile site m.bluemooncafe.us). 

Any solutions or suggestions? Or is an .htacess solution just not possible for this configuration?

######################################################################################## This .htaccess file redirects mobile browsers and devices to an alternate destination## Authors: vijay kumar Onlinetraffic.ie# onlineraffic.ie# Copyright 2012, onlinetraffic########################################################################################
# Ensure rewriting is onRewriteEngine On
# Check for redirect paramRewriteCond %{QUERY_STRING} ^.*redirect=true.*RewriteRule ^(.*)$ - [co=gomobi_prevent_redirect:false:.www.bluemooncafe.us:0:/]
RewriteCond %{QUERY_STRING} ^.*redirect=false.*RewriteRule ^(.*)$ - [co=gomobi_prevent_redirect:true:.www.bluemooncafe.us:7200:/]
RewriteCond %{HTTP_COOKIE} !gomobi_prevent_redirect=true [OR]RewriteCond %{QUERY_STRING} ^.*redirect=true.*
# Don't redirect if its falseRewriteCond %{QUERY_STRING} !^.*redirect=false.*
# Exclude certain paths e.g. cpanel admin etc.RewriteCond %{REQUEST_URI} !(.*)cpanel(/?)$
# Switch based on significant accept headersRewriteCond %{HTTP_ACCEPT} "text/vnd.wap.wml|application/vnd.wap.xhtml+xml" [NC,OR]
# Specific devices/mandufacturersRewriteCond %{HTTP_USER_AGENT} "iphone|ipad|ipod|android|nokia|ios|opera m(ob|in)i|iemobile|symbian|samsung|sec-|htc|huawei|ericsson|sonyericsson|blackberry|motorola|sagem|kyocera|zte|kddi|docomo|j-phone|kwc|lenovo|lg|mot|softbank|nec|audiovox|alcatel|sharp|sie-|sanyo|sendo|amoi|xda|bird|benq|palm|pantech|panasonic|fly|asus-|baiduispider|googlebot-mobile|nintendo|psp|dalvik|windows ce|foma|brew|webos|fennec|netfront|teleca|obigo|vodafone|up.browser|portalmmm" [NC]
RewriteRule ^(.*)$ m.bluemooncafe.us [L,R=302]"

Re: simple .htaccess solution? 12 years, 2 months ago #11569

Here is the link code I use for "View Main Website":
bluemooncafe.us/?no_redirect=true

I also tried this without luck: 
bluemooncafe.us/index.htm?no_redirect=true
Last Edit: 12 years, 2 months ago by beyondthenet.

Re: simple .htaccess solution? 12 years, 2 months ago #11576

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
In MJ you can redirect mobile devices to a subdomain (or another domain) by set corresponding values in Subdomain fields in "Advanced settings" tab of MJ settings page. Htaccess is unnecessary.

Re: simple .htaccess solution? 12 years, 2 months ago #11579

I understand the settings as we have used mobilejoomla for a few Joomla sites but this is for a different situation. The non-mobile site is not joomla (bluemooncafe.us).

Only the mobile site is Joomla. m.bluemooncafe.us/mobile

Re: simple .htaccess solution? 12 years, 2 months ago #11580

  • dryabov
  • OFFLINE
  • Administrator
  • Denis Ryabov, Lead Developer
  • Posts: 4867
  • Karma: 105
Looks like currently it's redirected to m,bluemooncafe.us using static.dudamobile.com/DM_redirect.js script instead of .htaccess file. Is it really your current .htaccess?

Re: simple .htaccess solution? 12 years, 2 months ago #11586

Yes, I switched to dudamobile code but I just switched back to the .htaccess to show you my preferred solution.  See that it now works perfectly on www.mobilephoneemulator.com

The only problem is that the "View Main Website" link no longer works. (This "View Main Website" link does work with the dudamobile link but dudamobile code does not work with this emulator.)

Thus, if we can find a solution for the "View Main Website" link then mobilejoomla can be used in the same way duda is used (no limits!). Duda's vision is very big, I believe they were just bought out by Google for several million.
  • 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.