Using only %postname%
What I did was reinstalled WordPress from the Dashboard Update area…then I made the Permalinks like this /index.php/%postname%/ It worked fine
What I did was reinstalled WordPress from the Dashboard Update area…then I made the Permalinks like this /index.php/%postname%/ It worked fine
Everything after the ? is considered part of the query string. Everything before the ? is part of the pretty permalinks, aka rewrite rules. Rewrite rules are then processed to generate query variables. These are then plugged into a query ( which powers the main loop ), and a template is loaded based on this … Read more
So first, I’m quoting @MrWhite’s comment: You can’t do that sort of redirect in .htaccess – where are you expected to get the posts-category part from? And he’s right — you shouldn’t use the .htaccess. We have over 2,000 articles and 55,000 backlinks to these articles. If I just change the permalinks I will have … Read more
Think I found a solution… Since anything after the %post_id%/__ will redirect to the full slug, a simple RewriteRule in the .htaccess file appears to do the trick. I had to place it above other RewriteRules and this is working for me. RewriteRule ^post/(\d*)/?\z$ http://noahcoad.com/post/$1/a [R=301,L]
The reason it isn’t working is because you haven’t told WordPress how to handle that page. You can do so by applying a rewrite rule in the following manner. add_action( ‘init’, ‘wpse_63716_search_rule’ ); function wpse_63716_search_rule(){ add_rewrite_rule(‘^suche/([^/]*)?’, ‘index.php?s=$matches[1]’, ‘top’); } Don’t forget to flush the permalinks after adding the above code.
You may use the format argument of wp_link_pages function like this: <?php $args = array( ‘base’ => ‘%_%’, ‘format’ => ‘?page=%#%’, ‘total’ => 1, ‘current’ => 0, ‘show_all’ => False, ‘end_size’ => 1, ‘mid_size’ => 2, ‘prev_next’ => True, ‘prev_text’ => __(‘« Previous’), ‘next_text’ => __(‘Next »’), ‘type’ => ‘plain’, ‘add_args’ => False, ‘add_fragment’ => … Read more
You can use add_rewrite_rule hooked to the init action, instead of using the generate_rewrite_rules filter (where it gets a bit low-level). But the actual problem with your rewrite rules is the regex in place. Here’s what it’d look like: function wtnerd_edition_specific_categories() { add_rewrite_rule( ‘(.+?)/channel/(.+?)/feed/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘(.+?)/channel/(.+?)/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&feed=$matches[3]’, ‘top’ ); add_rewrite_rule( ‘(.+?)/channel/(.+?)/page/?([0-9]{1,})/?$’, ‘index.php?category_name=$matches[1]&channel=$matches[2]&paged=$matches[3]’, … Read more
This issues is caused due to IIS does not recognize the multi language urls, You need to add the following code at the end of the wp-config.php file: if ( isset($_SERVER[‘UNENCODED_URL’]) ) { $_SERVER[‘REQUEST_URI’] = $_SERVER[‘UNENCODED_URL’];}
I think can do: add_action(‘template_redirect’, ‘my_func’); function my_func(){ if(is_single()){ // catch the last string preg_match(‘/(.*)\/(.*?)\//’, $_SERVER[‘REQUEST_URI’], $new_array); $last_phrase= $new_array[2]; if(is_numeric($last_phrase)){ $id = $last_phrase; header(‘location: ‘. get_permalink($id) , true, 301); exit; } } }
You can use rewrite arg in register_post_type. You can have custom post type name different then rewrite slug. For example here is the sample code with custom post type project and it shows pages with http://shaowtriger.com/brands/naim/ Notice rewrite in $args add_action( ‘init’, ‘codex_brand_init’ ); function codex_brand_init() { $labels = array( ‘name’ => _x( ‘Brands’, ‘post … Read more