Rewrite Rule for Post “Subpage”, with pagination

After more research on url-rewriting add-rewrite-rule and rewrite-rules I got introduced to Redirect Canonical Redirects incoming links to the proper URL based on the site url. Search engines consider www.somedomain.com and somedomain.com to be two different URLs when they both go to the same location. This SEO enhancement prevents penalty for duplicate content by redirecting … Read more

Dynamic URL, not a physical page within the database

add_rewrite_rule can help you sniff the request and let you handle it however you want. if( ! class_exists(‘PropertiesEndpoint’)): class PropertiesEndpoint { // WordPress hooks public function init() { add_filter(‘query_vars’, array($this, ‘add_query_vars’), 0); add_action(‘parse_request’, array($this, ‘sniff_requests’), 0); add_action(‘init’, array($this, ‘add_endpoint’), 0); } // Add public query vars public function add_query_vars($vars) { $vars[] = ‘__properties’; $vars[] = … Read more

add_rewrite_rule again

Here’s an example with template_redirect that loads your php script if the prm1 query var is set: // set up the rewrite add_action( ‘init’, ‘wpse36736_setup_rewrites’ ); function wpse36736_setup_rewrites(){ add_rewrite_rule( ‘snpv/([^/]+)’, ‘index.php?prm1=$matches[1]’, ‘top’ ); } // add query var add_filter(‘query_vars’, ‘wpse36736_query_vars’); function wpse36736_query_vars( $query_vars ){ $query_vars[] = ‘prm1’; return $query_vars; } // check the query var … Read more

Nice RSS Feed URLs for each custom post type

If you set ‘has_archive’ => TRUE in register_post_type() the post type will have its own feed on /books/feed/ and its items are not included in the main feed. Example plugin <?php /* Plugin Name: WPSE13006 feed for CPT demo */ ! defined( ‘ABSPATH’ ) and exit; add_action( ‘init’, ‘wpse13006_register’ ); // Call wp-admin/options-permalink.php once after … Read more