htaccess redirect to production when assets 404
November 06, 2019
I’d seen this mentioned at a WordPress Wellington meetup a while back and couldn’t remember the syntax; luckily I found it again on this Jonathan Nicols site
# Load media files from production server if they don't exist locally
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{HTTP_HOST} ^localsite\.dev$
RewriteRule ^wp-content/uploads/(.*)$ http://remotesite.com/wp-content/uploads/$1 [NC,L]
</IfModule>
Chrome bugging you about insecure connections on localhost?
Sick of clicking Trust this site on your own Localhost. Like seriously chrome 🤦🏼♂️
Exclude a folder from your git diff
Need a way to show your git diff in your terminal while excluding a folder from your results? While boy do I have a trick for you!
Get Cloudflare geolocation data client side
Cloudflare provide a very handy HTTP Header called `CF-IPCountry` which you can use to detect your users geolocation but there is another way.
What y’all thought