404 with post name permalinks

I was able to figure out the problem, and for the sake of posterity, I’m posting the answer here. Basically, the new apache2.conf file that was added when I updated my web server had the following lines in it (my document root is /var/www): <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride None Require all granted </Directory> … Read more

Change permalink of post if it belongs to custom taxonomy

You can modify the permalinks using the the_permalink filter and add a rewrite rule using add_rewrite_rule to redirect the new permalinks to the standard post link. function mysite_modify_permalink($url) { global $post; //if taxonomy archive for Series get term $term = is_tax(‘Series’)?get_query_var(‘term’):”; if(empty($term)) { //if no term was found //get all Series terms for current post … Read more

I need a custom permalink for my website

I’m not sure if I should assume that you were issuing your examples inside of the init hook, but if not that is the reason they weren’t working for you. So inside functions.php function sd_rewrite_rules() { add_rewrite_tag(‘%domain_name%’, ‘([^&]+)’); add_rewrite_rule(‘^/([^/]*)/?’,’index.php?domain_name=$matches[1]’,’top’); } add_action(‘init’, ‘sd_rewrite_rules’, 10, 0); Then if you wanted to retrieve the query variable to do … Read more