New answers tagged rewrite-rules
Internal rewrite rules should all point to index.php. You also need to set the proper query vars so that the main query can successfully run, in this case, to query for your detail page. add_rewrite_rule( 'detail/([^/]*)/([^/]*)/?$', 'index.php?pagename=detail&value1=$matches&value2=$matches', 'top' );
Found that solution useful I think, this is an expensive way to replace underscores with dashes. But this works at least in my test environment. The first rule replaces dashes one by one. The second rule then removes the prefix from the requested URL. RewriteBase / # replace underscores with dashes RewriteRule (.+?)_(.+) $1-$2 [R=302,L] # strip ...
you can remove this functionality by adding this code in a plugin or theme remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 ); This will remove all of dashboar, login, admin so if you will want some of them to still be there you will have to write your own replacement function to wp_redirect_admin_locations and hook it after you ...
The code you provided works as expected on a fresh install of WordPress (4.3.1 in this case). The ideas below shouldn't be considered an answer, so much as a checklist to aid in debugging the issue by narrowing the scope of the problem: You'll need to be logged in as a user with permission to view drafs to avoid a 404 or redirect. Try disabling your ...
You've got it the wrong way round - WordPress won't rewrite (redirect) your query string (known as canonicalization), but it will pass your parameters through if you use the rewritten URL: http://example.com/test/information/people Now if you print_r( $wp-query_vars ) in your template, you should get something like: Array ( [pagename] => test ...
Set has_archive to false in your arguments when registering your post type, flush your permalinks and you should be goog to go. EDIT has_archive (boolean or string) (optional) Enables post type archives. Will use $post_type as archive slug by default. Default: false
Top 50 recent answers are included