Dreamportal Homepage in Verwendung mit SMF4mobile

Started by stucki, June 16, 2015, 04:49:46 AM

Previous topic - Next topic

stucki

Moin Leute,

hab da ein kleines Problem bzgl. Dreamportal in Verbindung mit SMF4mobile.
Wenn ich beim Dreamportal die Homepage aktiviere, ist diese unter http://xyz.de/index.php zu erreichen und das Forum dann unter  http://xyz.de/index.php?action=forum

Soweit so gut.
Mit der Codeänderung in /Themes/default/DreamPortal.template.php

if(!empty($context['smf4mobile_version']))
   redirectexit('action=forum');
wird erfolgreich verhindert, dass beim aktivierten Dreamportal, beim Zugriff als Mobile User über das Theme SMF4Mobile die DP Module angezeigt werden.

Allerdings wird damit nicht die Dreamportal Homepage deaktiviert, die auf http://xyz.de/index.php gelegt ist. Wenn man nun als Mobile User über das Mobile Theme, dass Forum öffnet (http://xyz.de), landet man auf http://xyz.de/index.php. Der Inhalt kann im mobile Theme nicht dargestellt werden, da die Module vom DP deaktiviert wurden. Ich möchte nun, dass man als Mobile User quasi direkt auf http://xyz.de/index.php?action=forum  weitergeleitet wird, damit sich das Forum öffnet.

Ich hab nun schon [urlhttp://stackoverflow.com/questions/3680463/mobile-redirect-using-htaccess]diese Tricks[/url] via Htacces probiert, leider lande ich immer in einer Weiterleitungs Schleife als mobile User.
Aktuell habe ich in der Htaccess den Code hinterlegt:
<IfModule mod_rewrite.c>
        RewriteBase /
        RewriteEngine On

        # Check if mobile=1 is set and set cookie 'mobile' equal to 1
        RewriteCond %{QUERY_STRING} (^|&)mobile=1(&|$)
        RewriteRule ^ - [CO=mobile:1:%{HTTP_HOST}]

        # Check if mobile=0 is set and set cookie 'mobile' equal to 0
        RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
        RewriteRule ^ - [CO=mobile:0:%{HTTP_HOST}]

        # cookie can't be set and read in the same request so check
        RewriteCond %{QUERY_STRING} (^|&)mobile=0(&|$)
        RewriteRule ^ - [S=1]

        # Check if this looks like a mobile device
        RewriteCond %{HTTP:x-wap-profile} !^$ [OR]
        RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC,OR]
        RewriteCond %{HTTP:Profile}       !^$

        # Check if we're not already on the mobile site
        RewriteCond %{HTTP_HOST}          !^m\.
        # Check to make sure we haven't set the cookie before
        RewriteCond %{HTTP:Cookie}        !\mobile=0(;|$)
        # Now redirect to the mobile site
        RewriteRule ^ http://www.mysite.com/m/ [R]
    </IfModule>


Ich hab mir dann einen Unterordner "m" angelegt und in diesem eine htaacess mit folgenden Code reingepackt.
#Begin user agent loop fix

         RewriteEngine Off
         RewriteBase /

    #End user agent loop fix

Funktioniert so weit, als mobile landet man im Unterordner http://xyz.de/m/ und als Desktop User funktioniert alles wie gewollt.

Aber wie bekomme ich es hin, dass der mobile User bei http://xyz.de/index.php?action=forum und nicht bei http://xyz.de/index.php landet?

Danke schon mal vorab für die Hilfe:)


stucki

Ich frage mal anders, wie kann ich die mobile User ohne den ganzen htacess Kram von http://xyz.de/index.php  auf http://xyz.de/index.php?action=forum  umleiten?

stucki


wintstar

Regards Stephan

,,In order for the possible to come into being, the impossible must be attempted again and again."
Hermann Hesse (1877-1962)

My HomepageMy Board - My Atelier

Advertisement: