.htaccess Rewrite tips and tricks

Posted On May 24, 2018

Kodewulf

Web developer and code junkie. Dabbling in just about anything that interests me.

Rewrite legacy GET parameters to “PrettyURLs”

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/orders [NC]
RewriteCond %{QUERY_STRING} ^id=([0-9]+)$ [NC]
RewriteRule ^(.*)$ %{REQUEST_URI}/%1? [R,L]

More adventures

Javascript sticky header magic

Some sticky header magic.  If a sticky header overlaps some content at the top of the page, this will move page content down a bit.

Google Event Tracking

Google gtag.js event code To be included in HEAD, replacing #### with UA identifier <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=UA-#########-1"></script> <script>...

Share This

Share this post with your friends!