add_rewrite_rule does not work when .htaccess works
-
Hi I want to write a plugin, when custom post types are used, it requires having mod_rewrite changes, WP offers API for that purpose, but I can’t understand how they work, or what I do wrong. I have a rule in .htaccess which actually does a job
RewriteRule ^news/((?!\d{1,3}/?$).+)/?$ /?pt-news=$1 [L,QSA,NC]
I want to move it to WP API and add to functions.php that code:
add_rewrite_rule("^news/((?!\d{1,3}/?$).+)/?$", '/?pt-news=$1 [L,QSA,NC]', 'top');
It has not any affect on WP behavior, what do I do wrong?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘add_rewrite_rule does not work when .htaccess works’ is closed to new replies.