Disabling direct access to images using .htaccess

I have added the following rewrite rule to my .htaccess (above the previous rewrite rule): RewriteRule ^wp-content/uploads/(.*)$ dl-file.php?file=$1 [QSA,L] You presumably have another .htaccess file in the /wp subdirectory that contains the main WordPress directives (ie. # BEGIN WordPress etc.). You should be adding the above rule to the /wp/.htaccess file, not the one in … Read more

TimThumb & htaccess : clean url

Cadeyrn’s code work probably for 1 specific size ( 200&w=350& etc) , the major problem with timthumb and the reason people use it, is that it allows for many dynamic sizes thus making .htaccess rewrite rules much more difficult, especially if you using friendly WordPress permalink structure. There is a guide here on how to … Read more

Custom URL rewrites work, but break my permalinks

Well I solved it – in a rather unsatisfactory way – by explicitly re-defining the default posts rule in my own code. i.e. $rewrite_keywords_structure = $wp_rewrite->root.”/%year%/%monthnum%/%postname%/”; ..etc.. I don’t really understand why this is necessary, but there you go.

How To Consistently Enforce Rewrite Rule in Plugin Development

Here’s a solution. See comments at the end… // I am a functions.php file of a plugin called “sample” — implement me slightly differently for a theme. // Note this code requires WP 3.0 or greater. class SAMPLE { public static function activatePlugin() { self::rewriteURL(); flush_rewrite_rules(); if (get_option(‘permalink_structure’) == ”) { self::updatePermalinks(); } // add … Read more