Rewrite for mobile device
19 posts
• Page 1 of 1
Rewrite for mobile device
Hi,
I am using APE and have a URL rewrite code that is broken, which I am hoping you can help to fix.
I have a Wordpress installation that uses a plugin called WP Super Cache to create static html files. It creates a separate html file for desktop, mobile and https: index.html and index.html.gz for desktop and index-mobile.html and index-mobile.html.gz for mobile and index-https.html and index-https.html.gz for https.
The current code serves the index.html or index.html.gz regardless of device. What should I add/change to get it to serve the mobile version for mobile devices.
I am using APE and have a URL rewrite code that is broken, which I am hoping you can help to fix.
I have a Wordpress installation that uses a plugin called WP Super Cache to create static html files. It creates a separate html file for desktop, mobile and https: index.html and index.html.gz for desktop and index-mobile.html and index-mobile.html.gz for mobile and index-https.html and index-https.html.gz for https.
The current code serves the index.html or index.html.gz regardless of device. What should I add/change to get it to serve the mobile version for mobile devices.
- Code: Select all
# BEGIN WPSuperCache
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#If you serve pages from behind a proxy you may want to change 'RewriteCond %{HTTPS} on' to something more sensible
AddDefaultCharset UTF-8
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry9500|BlackBerry9520|BlackBerry9530|BlackBerry9550|BlackBerry\ 9800|BlackBerry\ 9850|BlackBerry\ 9860|BlackBerry\ 9780|BlackBerry\ 9790|BlackBerry\ 9900|BlackBerry\ 9930|BlackBerry\ 9350|BlackBerry\ 9360|BlackBerry\ 9370|BlackBerry\ 9380|BlackBerry\ 9810|webOS|s8000|bada|IEMobile/7.0|Googlebot-Mobile|AdsBot-Google).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{HTTPS} on
RewriteCond %{DOCUMENT_ROOT}/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz -f
RewriteRule ^(.*) "/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html.gz" [L]
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry9500|BlackBerry9520|BlackBerry9530|BlackBerry9550|BlackBerry\ 9800|BlackBerry\ 9850|BlackBerry\ 9860|BlackBerry\ 9780|BlackBerry\ 9790|BlackBerry\ 9900|BlackBerry\ 9930|BlackBerry\ 9350|BlackBerry\ 9360|BlackBerry\ 9370|BlackBerry\ 9380|BlackBerry\ 9810|webOS|s8000|bada|IEMobile/7.0|Googlebot-Mobile|AdsBot-Google).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTP:Accept-Encoding} gzip
RewriteCond %{HTTPS} !on
RewriteCond %{DOCUMENT_ROOT}/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz -f
RewriteRule ^(.*) "/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html.gz" [L]
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry9500|BlackBerry9520|BlackBerry9530|BlackBerry9550|BlackBerry\ 9800|BlackBerry\ 9850|BlackBerry\ 9860|BlackBerry\ 9780|BlackBerry\ 9790|BlackBerry\ 9900|BlackBerry\ 9930|BlackBerry\ 9350|BlackBerry\ 9360|BlackBerry\ 9370|BlackBerry\ 9380|BlackBerry\ 9810|webOS|s8000|bada|IEMobile/7.0|Googlebot-Mobile|AdsBot-Google).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTPS} on
RewriteCond %{DOCUMENT_ROOT}/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html -f
RewriteRule ^(.*) "/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index-https.html" [L]
RewriteCond %{REQUEST_URI} !^.*[^/]$
RewriteCond %{REQUEST_URI} !^.*//.*$
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800|iPhone|iPod|incognito|webmate|Android|dream|CUPCAKE|froyo|BlackBerry9500|BlackBerry9520|BlackBerry9530|BlackBerry9550|BlackBerry\ 9800|BlackBerry\ 9850|BlackBerry\ 9860|BlackBerry\ 9780|BlackBerry\ 9790|BlackBerry\ 9900|BlackBerry\ 9930|BlackBerry\ 9350|BlackBerry\ 9360|BlackBerry\ 9370|BlackBerry\ 9380|BlackBerry\ 9810|webOS|s8000|bada|IEMobile/7.0|Googlebot-Mobile|AdsBot-Google).* [NC]
RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).* [NC]
RewriteCond %{HTTPS} !on
RewriteCond %{DOCUMENT_ROOT}/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html -f
RewriteRule ^(.*) "/C:/wwwroot/wp-content/cache/supercache/%{SERVER_NAME}/$1/index.html" [L]
</IfModule>
# END WPSuperCache
# BEGIN supercache
<IfModule mod_mime.c>
<FilesMatch "\.html\.gz$">
ForceType text/html
FileETag None
</FilesMatch>
AddEncoding gzip .gz
AddType text/html .gz
</IfModule>
<IfModule mod_deflate.c>
SetEnvIfNoCase Request_URI \.gz$ no-gzip
</IfModule>
<IfModule mod_headers.c>
Header set Vary "Accept-Encoding, Cookie"
Header set Cache-Control 'max-age=3, must-revalidate'
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/html A3
</IfModule>
# END supercache
Re: Rewrite for mobile device
Hello.
I see some rules for non-mobile content in your config but there seem to be no rules for mobile clients. I suppose this "WP Super Cache" should provide some rules on it or there should be some documentation how to tune it for mobile clients.
I see some rules for non-mobile content in your config but there seem to be no rules for mobile clients. I suppose this "WP Super Cache" should provide some rules on it or there should be some documentation how to tune it for mobile clients.
Re: Rewrite for mobile device
The script is perfectly all right. I just run it. It's working perfectly well for me. Instead of running hole script, You can try out a simple app from Vshare Market app store which is working like charm.
Thanks in advance.
Thanks in advance.
- chelsieanayas
- Posts: 1
- Joined: 26 Jun 2017, 05:27
Re: Rewrite for mobile device
Just a smile and the rain is gone Can hardly believe it, yeah. There's an angel standing next to me. Reaching for my heart Just a smile and there's no way back .Can hardly believe it, yeah But there's an angel calling me. Reaching for my heart I know that I'll be okay now. This time, it's real I lay my love on you It's all I wanna do Every time I breathe I feel brand new You open up my heart Show me all your love and walk right through As I lay my love on you. fireboy and watergirl 4
dumb ways to die
dumb ways to die
- sureshsingh6117
- Posts: 1
- Joined: 03 Aug 2017, 18:00
Re: Rewrite for mobile device
Our eyes will always be on torrents to download the movies, games, TV shows etc. to download the movies and shoes, we need a application for downloading torrents, there are many torrent software are available on the internet http://appforfree.net/utorrent-pro-apk/
- halloween2017
- Posts: 1
- Joined: 03 Aug 2017, 20:27
Re: Rewrite for mobile device
The latest and unique new born baby girl costumes are really great to wear. Disney character Halloween costumes for new born baby girl. Cinderella Halloween costumes for new born baby will give a great look.
Re: Rewrite for mobile device
Interesting article! Thank you for sharing them! I hope you will continue to have similar posts to share with everyone!
- - - Lily Oliver - - -
madalin stunt cars 2
- - - Lily Oliver - - -
madalin stunt cars 2
check cashing near me
Really endure in mind United States and that we can money your test terribly brief amount with a virtually low charge.
<a href="http://www.unitedcheckcashing.com/">check cashing near me</a>
<a href="http://www.unitedcheckcashing.com/">check cashing near me</a>
- i8o2l4xs8a
- Posts: 1
- Joined: 14 Oct 2017, 13:04
Re: Rewrite for mobile device
I guess you will love to download GarageBand Apk for Android for Android Smartphone! http://www.garagebandforandroid.com/2017/08/garageband-apk-download.html
Re: Rewrite for mobile device
http://www.medicamentfrance.net/original-viagra-acheter-en-ligne-sans-ordonnance.html pour se procurer du sildenafil
Re: Rewrite for mobile device
easy to finding us http://www.unitedcheckcashing.com as we are at your city or nearest places. Just remember us and we will cash your check very short period with a very low cost.
- Code: Select all
check cashing
Re: Rewrite for mobile device
i think you can trial change ssl to ss. Before i had a trouble the same. good luky!
- annashetty
- Posts: 5
- Joined: 14 Sep 2017, 23:30
Re: Rewrite for mobile device
Your topic has a lot of useful information for myself. I visit regularly. Hope to have more quality items.
----------------------
----------------------
Aolmaillogin
With the effect of digitalization, there are a lot of companies in existence now, but back in the days of 1990s, there were only a countable number of companies which used to rule the internet world. American Online or is one of them. The name itself makes many nostalgic whenever someone lived in that period of time remembers AOL. This was the reputation of <a href="https://mailsignins.com/www-aolmail-com-aol-login-signup-registration/">aolmail.com</a>
- polesmith0414
- Posts: 1
- Joined: 17 Mar 2018, 08:58
- Location: United States
Anker Products
Today mobile is one of the most useful devices by people. https://www.promoocodes.com/coupons/anker/ is the place where you can find power banks and chargers for your mobiles and laptops. Thank you for this great post.
19 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests