Answer the question
In order to leave comments, you need to log in
Wordpress and rewrite_rule, why doesn't the .htaccess rule work?
There is a rule in functions.php, it works but doesn't make any changes to .htaccess
add_action( 'init', 'do_rewrite', 10, 0);
function do_rewrite(){
add_rewrite_rule(
'profile/(\w+)/?$',
'index.php?pagename=profile&property_id=$matches[1]',
'top' );
}
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^profile/(\w+)/?$ /index.php?pagename=profile&property_id=$matches[1] [L]
</IfModule>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question