Community Forums › Forums › Archived Forums › General Discussion › Remove Query Strings Genesis
Tagged: remove query strings genesis
- This topic has 3 replies, 3 voices, and was last updated 11 years, 3 months ago by
aureliendebord.
-
AuthorPosts
-
June 19, 2014 at 4:42 am #110530
samw
MemberHi
Can anyone suggest the code to remove query strings in genesis.
This code works in htaccess but it causes a drop in page speed as its using a rewrite
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} !=""
RewriteCond %{QUERY_STRING} !^p=.*
RewriteCond %{QUERY_STRING} !^s=.*
RewriteCond %{REQUEST_URI} !^/wp-admin.*
RewriteRule ^(.*)$ /$1? [R=301,L]
</IfModule>This code doesnt work at all but its WP specific
// Remove query string from static files
function remove_cssjs_ver( $src ) {
if( strpos( $src, '?ver=' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );The query strings are as follows:-
Domain name removed and replaced with xx
This need to have the query part removed as without it , the browser side cacheing cant pick these up even with an htaccess rule set. Thanks
http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css?ver=4.0.3
http://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3
xx/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.css?ver=2.4.8
xx/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.js?ver=2.4.8
xxwp-content/themes/minimum-pro/?ver=1.0
xxwp-content/themes/minimum-pro/js/backstretch-set.js?ver=1.0.0
xx/wp-content/themes/minimum-pro/js/backstretch.js?ver=1.0.0
xxwp-content/themes/minimum-pro/js/responsive-menu.js?ver=1.0.0
xx/wp-content/themes/minimum-pro/style.css?ver=3.0.1
xx/wp-includes/css/dashicons.min.css?ver=3.9.1
xx/wp-includes/js/comment-reply.min.js?ver=3.9.1
xx/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
xx/wp-includes/js/jquery/jquery.js?ver=1.11.0
June 20, 2014 at 6:35 pm #110872nutsandbolts
MemberYou might try this plugin: http://www.yourwpexpert.com/remove-query-strings-from-static-resources-wordpress-plugin/
It's very lightweight and does the job
Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
I provide development and training services for designers • Find me on Twitter and Google+June 20, 2014 at 8:56 pm #110887samw
MemberOctober 9, 2014 at 4:15 am #127188aureliendebord
MemberHello everyone,
Maybe it will help :
If you are using W3 Total Cache, you have to tick off "Prevent caching of objects after settings change " in the "browser cache" section.
Agence web Debord, building websites in France.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.