Three .htaccess rules that help unclutter Wordpress themes
I do Wordpress themes fairly regularly. They aren't amazing works of art, but they're (generally) perfectly functional sites that meet the needs of the folks using them.
To make my theme-developing life easier, I typically add the three following rules to the .htaccess file:
RewriteRule ^css/(.*) /wp-content/themes/[my-theme]/css/$1 [QSA,L] RewriteRule ^js/(.*) /wp-content/themes/[my-theme]/js/$1 [QSA,L] RewriteRule ^images/(.*) /wp-content/themes/[my-theme]/images/$1 [QSA,L]
Why? Well, instead of making script, style, and image references something like:
http://www.mysite.com/wp-content/themes/my-theme/css/style.css
I can simply do:
http://www.mysite.com/css/style.css
Personally, I haven't seen a downside to this yet. Maybe if Apache decides to stop handling rewrite rules or something, but I'd imagine there would be bigger problems if that were the case.
I'm putting these here so I can always find them and they might possibly help someone else, too.




