• Resolved ckov1

    (@ckov1)


    Hi,

    people on mobile can not make order because in url is showing : ?scfm-mobile=1

    and according the logs it put in loop and woocommerce can not proceed via payment methods

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ckov1

    (@ckov1)

    bad configuration in htacess … fix it mate

    nice day

    Plugin Author Jose

    (@giuse)

    Hi @ckov1

    thank you for reporting this issue.
    The rewrite conditions and rules are added by Specific Content For Mobile to prevent the issue with the cache. When you have a caching system that doesn’t distinguish between mobile and desktop, you have issues.
    By adding ?scfm-mobile=1 to the URL when the page is visited by a mobile device, you avoid that issue, because the cache for https://samplewebsite.com?scfm-mobile=1 will be different by the cache served fro https://samplewebsite.com.

    The intention was good, but honestly I didn’t realise you can have issues with Post requests.

    I suggest you try with this rules in .htaccess:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !scfm-mobile
    RewriteCond %{QUERY_STRING} !wc-ajax
    RewriteCond %{REQUEST_URI} !\.
    RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?%{QUERY_STRING}\&scfm-mobile=1 [L,NS,R=301]
    </IfModule>

    I tested the WooCommerce checkout after adding RewriteCond %{REQUEST_METHOD} !=POST and it works for me.
    That line is saying that ?scfm-mobile should be added only if there are no Post data.

    This is the code that the next version of SCFM will add to the .htaccess file.
    We need those rules because 99.9% of the support requests are because many websites have a caching system that doesn’t distinguish between desktop and mobile and they don’t know ho to fix it.

    If you still have issues, please let me know.

    Have a great day!

    Jose

    Plugin Author Jose

    (@giuse)

    Hi @ckov1
    I corrected the code for the .htaccess file.
    Here a new version of the code:

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !scfm-mobile
    RewriteCond %{QUERY_STRING} !wc-ajax
    RewriteCond %{QUERY_STRING} !^$
    RewriteCond %{REQUEST_URI} !\.
    RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?%{QUERY_STRING}\&scfm-mobile=1 [L,NS,R=301]
    RewriteCond %{HTTP_USER_AGENT} Mobile|Android|Silk/|Kindle|BlackBerry|Opera\ Mini|Opera\ Mobi [NC]
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !scfm-mobile
    RewriteCond %{QUERY_STRING} !wc-ajax
    RewriteCond %{QUERY_STRING} ^$
    RewriteCond %{REQUEST_URI} !\.
    RewriteRule ^(.*)$ %{REQUEST_SCHEME}://%{HTTP_HOST}%{REQUEST_URI}\?scfm-mobile=1 [L,NS,R=301]

    this is to remove a redirection when the URL has no query strings.
    The code above will be added by the new version of SCFM.

    Have a great day!

    Jose

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.