My permalinks are broken! Can I use mod_rewrite to ignore a physical file?

The reason that’s happening at all is because of content negotiation. /2011.html wouldn’t normally be accessible through /2011/, but content negotiation is making Apache automatically look for files named 2011 (whatever the extension) when it can’t find the folder before it passes control to WordPress. This can be quite useful, but if you don’t particularly … Read more

Change author permalink

you need 3 simple functions and hooks first change the author base: //change author/username base to users/userID function change_author_permalinks() { global $wp_rewrite; // Change the value of the author permalink base to whatever you want here $wp_rewrite->author_base=”users”; $wp_rewrite->flush_rules(); } add_action(‘init’,’change_author_permalinks’); then add users to query_vars: add_filter(‘query_vars’, ‘users_query_vars’); function users_query_vars($vars) { // add lid to the … Read more

Masking wp-content/themes/name/images to just images directory using htaccess

Check out the Roots WordPress Theme. They seem to do exactly what you want with the URLs. Here’s a snippet from their roots-htaccess.php file: add_action( ‘generate_rewrite_rules’, ‘roots_add_rewrites’ ); function roots_add_rewrites($content) { $theme_name = next( explode( ‘/themes/’, get_stylesheet_directory() ) ); global $wp_rewrite; $roots_new_non_wp_rules = array( ‘css/(.*)’ => ‘wp-content/themes/’ . $theme_name . ‘/css/$1’, ‘js/(.*)’ => ‘wp-content/themes/’ . … Read more

How to create custom URL routes?

Add this to your theme’s functions.php, or put it in a plugin. add_action( ‘init’, ‘wpse26388_rewrites_init’ ); function wpse26388_rewrites_init(){ add_rewrite_rule( ‘properties/([0-9]+)/?$’, ‘index.php?pagename=properties&property_id=$matches[1]’, ‘top’ ); } add_filter( ‘query_vars’, ‘wpse26388_query_vars’ ); function wpse26388_query_vars( $query_vars ){ $query_vars[] = ‘property_id’; return $query_vars; } This adds a rewrite rule which directs requests to /properties/ with any combination of numbers following to … Read more

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