WordPress .htaccess – route other URLs to another app

Since your WordPress site is just a one-page site, this is served from the single URL http://example.com/. You then want http://example.com/<something> to be internally rewritten to http://example.com/app/<something>. You can add the following mod_rewrite directives before your existing WordPress directives (ie. WordPress front-controller) in your root .htaccess file: # Route all URL-paths (of 1 or more … Read more

Add a URL prefix to permalinks of News category and sub-categories of posts only

add_action( ‘init’, ‘wpa_category_base’ ); function wpa_category_base() { // Remember to flush the rules once manually after you added this code! add_rewrite_rule( // The regex to match the incoming URL ‘news/([^/]+)/([^/]+)/([^/]+)(/[0-9]+)?/?$’, // The resulting internal URL ‘index.php?category_name=$matches[1]/$matches[2]&name=$matches[3]&paged=$matches[4]’, // Add the rule to the top of the rewrite list ‘top’ ); } Custom permalink structure: /media/%category%/%postname%/ Category … Read more

Add filename to attachment page url

This doesn’t require a WordPress modification per se, but if you prefer to do it that way, here is a decent tutorial: http://shibashake.com/wordpress-theme/wordpress-page-redirect. Some people would, however, prefer to do this via the .htaccess file, here is a quick guide on how to do redirects that way: http://perishablepress.com/press/2006/01/10/stupid-htaccess-tricks/#red1.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)