Discussion:
Redundant rewrite rules help
BenderisGreat
2014-03-20 21:13:17 UTC
Permalink
I have a number of rewrite rules, and they all are prefaces with the same
initial rule;

add_rewrite_rule('member/([^/]+)$', 'index.php?member=$matches[1]',
'top');

If I have another page after member, it would look like this;


add_rewrite_rule('member/([^/]+)/second_var/?$',
'index.php?member=$matches[1]&second_var=second_var', 'bottom');


Is there a way to automatically include the top level rewrite rule on all
the rest? I am trying to make this more dynamic, and this makes it
difficult.





--
View this message in context: http://wordpress-hackers.1065353.n5.nabble.com/Redundant-rewrite-rules-help-tp43747.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.
Josh Pollock
2014-03-20 21:37:00 UTC
Permalink
Check out the attached PDF in this article:
http://hardcorewp.com/2014/hardcore-url-routing-for-wordpress/ Everything
you ever needed to know about rewrites.
Post by BenderisGreat
I have a number of rewrite rules, and they all are prefaces with the same
initial rule;
add_rewrite_rule('member/([^/]+)$', 'index.php?member=$matches[1]',
'top');
If I have another page after member, it would look like this;
add_rewrite_rule('member/([^/]+)/second_var/?$',
'index.php?member=$matches[1]&second_var=second_var', 'bottom');
Is there a way to automatically include the top level rewrite rule on all
the rest? I am trying to make this more dynamic, and this makes it
difficult.
--
http://wordpress-hackers.1065353.n5.nabble.com/Redundant-rewrite-rules-help-tp43747.html
Sent from the Wordpress Hackers mailing list archive at Nabble.com.
_______________________________________________
wp-hackers mailing list
http://lists.automattic.com/mailman/listinfo/wp-hackers
Loading...