Custom URL rewrite with add_rewrite_rule

Updating the rewrite-rules manually as follows worked for me: function gallery_rewriterules( $wp_rewrite ) { $new_rules = array( “hochzeitsfotografen/([^/]+)/([^/]+)/?([0-9] {1,})/?” => “index.php?fotograf=”.$wp_rewrite->preg_index(1).”& gallery=”.$wp_rewrite->preg_index(2).”&img=”.$wp_rewrite->preg_index(3)); $wp_rewrite->rules = $new_rules + $wp_rewrite->rules; } add_filter(‘generate_rewrite_rules’,’gallery_rewriterules’);

Rewrite Page Parameters

If city belongs to the page post type, then your rule should either be: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?pagename=city&id=$matches[1]’, ‘top’ ); or: add_rewrite_rule( ‘^city/([^/]*)/?’, ‘index.php?page_id=5&id=$matches[1]’, ‘top’ ); Using p, the query will assume post type is post, not page. Also, if your code uses $_GET[‘id’] to fetch the value, this will no longer work with a rewrite … Read more

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