Handle category name URL rewrite before different post type slugs

After some brainstorming and a lot of trial and error with T5 Rewrite and HM Rewrite, I went for the simplest possible solution. The permalink was actually intercepted by WordPress so I didn’t need the additional rewrite rule (even though it didn’t hurt, other than performance). I left %category%/%post_id%/%postname% as the default custom permalink, and … Read more

Using WordPress with Apache behind an nginx reverse proxy

You’re missing your WordPress rewrite rules. It’s probably confusing because, in Apache, WordPresss automatically generates the rewrite rules in .htaccess. It does not do the same in nginx environments. Pay special attention to the WordPress documentation on nginx and configuration directives referencing HTTP rewrite rules, the “includes” directives for segmenting configuration and the specific WordPress … Read more

Disable wordpress pagination URL rewrite for specific page

The redirect_canonical filter is responsible for this, which you can selectively disable depending on the requested page. This is untested, but should work: function wpa66273_disable_canonical_redirect( $query ) { if( ‘design-jobs’ == $query->query_vars[‘pagename’] ) remove_filter( ‘template_redirect’, ‘redirect_canonical’ ); } add_action( ‘parse_query’, ‘wpa66273_disable_canonical_redirect’ );

add_rewrite_rule not loading correct page nor getting variables

This seems to work! ?post_type=directors&name=$matches[1] seems to be the key add_rewrite_rule( ‘directors/([^/]*)/showreels/([^/]*)/video/([^/]*)/?’, ‘index.php?post_type=directors&name=$matches[1]&showreel=$matches[2]&video=$matches[3]’, ‘top’ ); so final code now; function wpse13483_init() { add_rewrite_rule( ‘directors/([^/]*)/showreels/([^/]*)/video/([^/]*)/?’, ‘index.php?post_type=directors&name=$matches[1]&showreel=$matches[2]&video=$matches[3]’, ‘top’ ); } add_action( ‘init’, ‘wpse13483_init’ ); function wpa52794_query_vars( $vars) { $vars[] = ‘video’; $vars[] = ‘showreel’; return $vars; } add_filter( ‘query_vars’, ‘wpa52794_query_vars’ );

How to prevent redirection to max 2147483647 for larger values of the page query variable?

The Why Part If we have a page called technical and try to load: example.tld/technical/99999999999999999999 then the 99999999999999999999 part is treated as a page query variable with the value of 2147483647. The reason is this rewrite rule for pages: according to the handy Monkeyman Rewrite Analyzer by Jan Fabry. This part of the WP_Query::get_posts(): if … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)