Custom WordPress user permalink

the problem with this question, and of a lot of questions like this, is the one pinted out by @Milo in comments: if you write a rewrite rule to handle you custom url, this goes in conflict with WordPress rules, e.g. if your urls are htt://example.com/username/city/occupation how WordPress can know if you are actually lookin … Read more

Using WP Rewrite, but just not “getting it”

Your rewrite setting is good, but WordPress are redirect to the canonical url of the post. This is done by WodPress to prevent bad indexing for duplicate content (when an identical content is accessible via 2 different urls). You can prevent that removing the canonical redirect filter: add_action(‘wp_loaded’, function() { remove_filter(‘template_redirect’, ‘redirect_canonical’); }); However this … Read more

Is a permastruct possible on pages?

Yes this is possible using the $wp->add_query_var function used together with add_rewrite_rule . Here you have an example: Passing and retrieving query vars in wordpress If you want more help here is a cut from one of my old plugins: function createRewriteRules() { global $wp_rewrite; $new_rules = array( ‘(.?.+?)/(stenskott)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. $wp_rewrite->preg_index(1), “(.?.+?)/(bilclas)$’ => ‘index.php?pagename=”.$wp_rewrite->preg_index(2).”&ort=”. … Read more

Exclude / Blacklist Permalinks

Interesting question. I found this post and tested, it worked for me: http://wpdreamer.com/2012/03/how-to-define-reserve-slugs-for-wordpress-posts-and-pages/ If you don’t want to edit your functions.php file an inelegant solution you can try is to create empty placeholder pages with the permalinks you’d like to reserve. If there is a physical directory on the server with that same name that … Read more

Redirect & permalink problems after moving multisite to a new server

Well, the answer has several different ways.. ==Method 1== (when you want your website permalinks to become like example.com/wp/smth ) if so, just change this: RewriteBase / to RewriteBase /wp and in database, change all occurrences of example.com/ to example.com/wp/ ==Method 2== (when you want your website permalinks to remain example.com/smth ) Now you have … Read more