everday I concern myself with big ideas & elegant solutions

If you're interesting in chatting about freelance work either contact me at The Observatory or via the various social media links below and find out how I can help your business.

WordPress troubles with .htaccess & 500 errors

Update – Thanks to @retlehs pointing out, this issue is with an old version of Roots and HTML5 Boilerplate htaccess has now been moved to a plugin.

I recently had an issue with a client’s site that I’d inherited. It was a WordPress (up-to-date) and was running a theme based on Roots. I’ve used Roots a few times before and it’s always been rock solid, although due to the amount of stuff it does straight out of the box, sometimes these functions can cause errors.

The site in question was creating a 500 Internal Server error which would go away when the .htaccess file was replaced with a default one. This would be fine until the Dashboard was accessed, where upon the 500 error would appear again. Turns out Roots was set to inject the HTML5 boilerplate .htaccess content into the .htaccess file. This ordinarily isn’t a problem (it does a load of useful stuff) but in this case, the hosting environment didn’t allow this function and therefore was creating the error.

The fix was simple. Go to /themes/roots/inc/roots-htaccess.php and comment out the following line.

add_filter('mod_rewrite_rules', 'roots_add_h5bp_htaccess');


//add_filter('mod_rewrite_rules', 'roots_add_h5bp_htaccess');

Once you’ve changed that and uploaded the change, replace your .htaccess file with a standard one and you should be fine.

Email Obfuscation with WordPress & Advanced Custom Fields

I tend to use WordPress as my main goto CMS and have found it’s use expanded greatly with Advanced Custom Fields (ACF) for tailoring the backend for clients.

I recently was asked to implement email obfuscation on a site using this setup so try to defeat crawlers/spammers (the endless fight…). I thought it’d be some use to share this with the world.

Here is what I started with…

<a href="mailto:<?php the_field('email'); ?>">
<?php the_field('email'); ?></a>


So currently the ACF field is called ‘email’ and is being entered as the mailto: link and the description. WordPress has a built in obfuscation ability called Antispambot which converts email addresses characters to HTML entities to block spam bots (not bulletproof but better than nothing).

To use this with ACF, you just have to add a variable that you then declare in the <a>.

<?php $email = get_field("email"); ?>
<a href="mailto:<?php echo antispambot($email); ?>">
<?php echo antispambot($email); ?></a>


Thanks to willthemoor for the hint.

Bitcoin : China & the Future

Most of the huge growth over the last few months has been driven by the Chinese market, so any negative news will impact this. Originally the news that ‘China has banned it’ was a mistranslation. It in fact stated that it wasn’t to be used by financial services, and was fine for use in a ‘barter’ format for the public.

The later news that has caused the continuing fall was due to the major exchanges not being allow to accept ¥ deposits, meaning that new users can’t enter the system. This is currently in a state of flux as some exchanges are reporting normal usage whereas others are definitely stopped from deposits. Likely all due to the ruling as to whether an exchange is a ‘financial service’ between companies and whether this applies to end user usage.

Due to it’s current volatility to headlines, Bitcoin’s value to Fiat will jump around for another few months in my opinion. Sadly, most will miss out on the more important headlines such as:-

The US merchant BitPay hitting $100m in transactions & over 15k approved merchants

25% of the Swiss Parliament wanting to rule it as a Currency for “it’s potential in their financial sector”

Early next year ZipZap offering cash-to-bitcoin services in 28k locations in the UK

In any case, from someone with an eye on this space for a while, I believe this image sums up the current situation nicely.


Older Posts