Canonicalization + Custom Post Types not working as expected

Think ive solved it and can’t believe what it was! On my rewrite rule I had: add_rewrite_rule( ‘custom-post-type/([0-9]+)/([^/]*)/?$’, ‘index.php?post_type=customposttype&p=$matches[1]’, ‘top’ ); Adding in and passing the post_name for the custom post type got it to start redirecting. add_rewrite_rule( ‘custom-post-type/([0-9]+)/([^/]*)/?$’, ‘index.php?post_type=customposttype&p=$matches[1]&customposttype=$matches[2]’, ‘top’ ); Anycase for now its late and it seems to have started working 🙂 … Read more

Custom Rewrite Problem

You can try these rules: reviews/([^/]+)/page/?([0-9]{1,})/?$ reviews/([^/]+)/?$ It’s informative to check out the active rewrite rules with: function show_rewrite_rules( $rules ) { if(is_admin()) echo “<pre>”.print_r($rules,true).”</pre>”; return $rules; } add_filter(‘rewrite_rules_array’,’show_rewrite_rules’); and then visit /wp-admin/options-permalink.php. There exists also some good plugins for analysing the rewrite rules, for example the Monkeyman Rewrite Analyzer.

Rewriting WordPress URLs

The first important difference between your rewrite rule, and the ones that Pippin has provided is that all of his rewrite rules point to index.php. This is an absolute must, you won’t get it to work any other way, all requests must point to index.php with your query vars appended. The second important thing to … Read more

URL Rewriting in WordPress

Your best bet for an easy solution is to actually use the “Custom Structure” option in your WordPress admin under Settings > Permalinks. There are a number of other structure tags you may use as seen in the Codex. If you’re looking for even more customization and manual control, it’s actually a pretty complex topic … Read more

Additional .htaccess rules based on wp page

I’m pretty sure you have wrong “rewrite” parameter in your add_rewrite_rule call. I’m writing it directly in here, so it can be buggy… But it should look something like this: add_rewrite_rule(‘^authors/([^/]*)/([^/]*)/?’,’index.php?page_id=<YOUR AUTHOR PAGE ID>&my_author_name=$matches[1]&my_author_pic=$matches[2]’,’top’); Then you can use add_rewrite_tag (http://codex.wordpress.org/Rewrite_API/add_rewrite_tag) to add your custom query variables (my_author_name and my_author_pic). And in your author page you … Read more

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