Hi @bufisys
thank you for the information and for your solution.
Theoretically, you don’t need that script. You should find this in your .htaccess file:
# BEGIN Specific Content For Mobile
<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 %{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]
</IfModule>
# END Specific Content For Mobile
The code above is added by SCFM to add exactly the query string you are adding via JavaScript.
If the redirect is done from the .htaccess file, it will consume practically zero. On the contrary, if you do it via JavaScript, PHP + MySql have to run before building the page, then the page is sent to the browser, and only when the browser parses your script you have the redirect. This is bad for performance.
You should check your .htaccess file, and if you don’t find the code described above, we should try to understand why you don’t have it.
If you don’t find that code, I suggest you:
- Be sure you have the latest version of Specific Content For Mobile
- Disable and enable again (without removing it because you would lose the settings) Specific Content For Mobile
- Visit the backend page Settings => Permalinks
- Check again the file .htaccess
- Delete the browser cache
- Delete the FlyingPress and FlyingCDN cache
Please, let me know if you can see that code in your .htaccess file.
Have a great day!
Jose