.htaccess rewrite

It looks like you need to process the rewrite using query strings rather than a URI segment and pass your query through index.php. WordPress seems to be agnostic of what you’re trying to accomplish here. Try the following rule and visit your Settings->Permalinks page to flush previous rules and add this to the stack. add_rewrite_rule( … Read more

Monkey Man Rewrite Analyzer says my rule will trigger but it doesn’t [closed]

Honestly, can not debug your code, but this one works: function register_crr_jsonwebservice( $wp_rewrite ) { //Add the rewrite rule for this specific json controller add_rewrite_tag( ‘%ticket%’, ‘([a-zA-Z0-9]+)’); $wp_rewrite->rules = array( ‘cjson/fullticket/?([a-zA-Z0-9]{1,})/?$’ => $wp_rewrite->index . “?page_id=243&ticket=”.$matches[1] ) + $wp_rewrite->rules; } add_action( ‘generate_rewrite_rules’, ‘register_crr_jsonwebservice’ ); Do not call flush_rewrite_rules(); from this function – will lead to an … Read more

WordPress Rewrites – How can I pass a variable to Custom Post Type?

You can use add_rewrite_endpoint, which will add a query var and generate the necessary rewrite rules: function wpd_cid_endpoint() { add_rewrite_endpoint( ‘cid’, EP_PERMALINK ); } add_action( ‘init’, ‘wpd_cid_endpoint’ ); Don’t forget to flush rewrite rules after changing rules. You can do this quickly by visiting the Settings > Permalinks page in admin.

WP is ignoring .htaccess rewritten URL

RewriteCond %{HTTP_HOST} dom1 [NC] RewriteRule ^((about\-us|etc).*) /dom1/$1 [NC,QSA,L] Your rewrite rule includes the L parameter, which makes it stop processing rewrites. So WordPress’s rules to redirect to index.php likely never come into effect. Which means WordPress is not even being run here. The 404 is likely from the webserver saying that the file at /dom1/about-us … Read more

Using WP Rewrite, but just not “getting it”

Your rewrite setting is good, but WordPress are redirect to the canonical url of the post. This is done by WodPress to prevent bad indexing for duplicate content (when an identical content is accessible via 2 different urls). You can prevent that removing the canonical redirect filter: add_action(‘wp_loaded’, function() { remove_filter(‘template_redirect’, ‘redirect_canonical’); }); However this … Read more