Add rewrite rule to make Woocommerce product category page seo friendly
Add rewrite rule to make Woocommerce product category page seo friendly
Add rewrite rule to make Woocommerce product category page seo friendly
see: WordPress 3.0.1 on IIS 6 Web Server PermaLink Issues
The reason adding second permalinks like that makes the first type inaccessible is because WordPress is interpretting both list-firemen-games and list-mario as list-firemen-games post types. To WordPress, the regular expression that is registered looks exactly the same (both look something like ([^/]+)\.php/?), so when it pulls that regular expression, it’s going to match that pattern … Read more
You need to set the rewrite parameter with_front to false inside your post type registration. ‘rewrite’ => array( ‘slug’ => your-posttype-slug, ‘with_front’ => false ), See the rewrite parameter on the register_post_type codex page.
As a starter, I recommend you review the discussion on a similar question regarding custom taxonomies and custom post types: Fixing Pagination with Custom Taxonomy Archive. You’ll probably need to work with the global rewrite/query variables and arguments to get things to work correctly.
Well this one is tricky. function my_plugin_query_vars($vars) { // add mypluginname to the valid list of variables $new_vars = array(‘mypluginname’); $vars = $new_vars + $vars; return $vars; } add_filter(‘query_vars’, ‘my_plugin_query_vars’); this will tell WordPress to accepts GET variables with the name mypluginname. so now you can process requests like http://www.example.com?mypluginname=param1 We add an action on … Read more
Changing the rewrite rules does not affect how WordPress writes links (except for the standard links, to posts, archives, … and then only in simple cases). The rewrite rules only cover how incoming URLs are handled, you are responsible for writing the links in the new format. This is different from frameworks with more advanced … Read more
The post_type_link hooks gets called for all links to custom post types, you are responsible for checking the link type. Remember to use the passed $post object (not post ID), otherwise you check the current global $post variable, which may not be the post for which you are creating a link now. So the code … Read more
It seems like what I want is something that WordPress’s internal permalink code isn’t prepared to deal with. After reading this writeup by Otto, I’ve come to understand that having my permalinks start with %category% could create a performance issue down the road and I would have to create a function that further alters the … Read more
As per the discussion in the comments, using . as a value for the “Category base” will send Apache into an infinite loop. Getting rid of the Category base in the URL is actually pretty tricky, just because of the way WordPress expects things to work. It you want to use a single character for … Read more