John Kavanagh
Indie WebDeveloper
Client-side and Front-end Development. Expert in cross-browser compatibilities, beautiful layouts, accessibility and advanced CSS/XHTML

Stop directory listing in Wordpress with htaccess

09.03.2009 0

Although this tip can (and should) be used for your normal website development as well, it is particularly relevant for WordPress websites where you’ve quite possibly paid for the theme you’re using and spent hours writing some of your plugins.

In a default WordPress installation directory listing is not protected, which means that anybody who knows you’re using WordPress can very easily gain access to your themes and plugins as shown in the screenshot below just using their internet browser and appending /wp-content/plugins/ or /wp-content/themes/ to your URL.

Read more

Auto-Compress CSS and JS with htaccess/PHP

03.03.2009 1

Auto-Compress CSS and JS with htaccess and PHP In the never-ending quest to reduce the amount of bandwidth your website uses (both to improve visitor load times and to keep your own overheads as low as possible), one of the simplest and easiest areas for improvement is often overlooked: compress your CSS and JavaScript.

Even just taking out all the erroneous white space can make a huge difference in the final size of the file. Of course, it annoys the hell out of people trying to digg through your code, but I sort of see that as an advantage too..! Of course, compressing your CSS and then having to revert back to an uncompressed version every time you want to make a change and re-compressing it again becomes a bit of a bore very quickly, so why not an automated method that will do it for you? With PHP and htaccess, it’s very, very easy.

Read more