custom_rewrite_rule returns 404 on weird path
-
The weirdest thing just happened…
On my local systeem (Mac OS) I have WP running and when i create a rewrite_rule
shown below, i HAVE TO start with ^xxx
If i use anything! else it will return a 404.
The template name (who is picking up the rewrite) is called something completely different. The created page in the admin is also named differently.How on earth is this possible?!!1
function custom_rewrite_tag() { add_rewrite_tag('%loc%', '([^&]+)'); } add_action('init', 'custom_rewrite_tag', 10, 0); function custom_rewrite_rule() { add_rewrite_rule('^xxx/([^/]*)/?','index.php?page_id=189&loc=$matches[1]','top'); } add_action('init', 'custom_rewrite_rule', 10, 0);
The topic ‘custom_rewrite_rule returns 404 on weird path’ is closed to new replies.