Configuring Home Page Address

If there is no clear evidence of any present redirect from the following sources: The htaccess, both under the public_html and under the public_html/folder (where folder is the directory having all the wp files), removing and regenerating them by mean of updating the permalinks, The .htaccess files were at some point deleted, and regenerated, The … Read more

Proper way to set up rewrite with Wp

See flush_rules in Codex: Because this function can be extremely costly in terms of performance, it should be used as sparingly as possible – such as during activation or deactivation of plugins or themes. Every attempt should be made to avoid using it in hooks that execute on each page load, such as init. Only … Read more

Permalinks – .htaccess

According to the official WordPress docs, when you save your Permalinks it updates your .htaccess file … This isn’t correct. When you switch from default– ?= permalinks which are nothing but pure PHP URL parameter passing– to anything else then WordPress will create a .htaccess file if it can, or tell you to create one. … Read more

404 redirect based on url

I would use the wp hook, which fires right after the request has been parsed and queried: function wpse_199869_wp( $wp ) { if ( ! is_admin() && is_404() && preg_match( ‘/^bh-job/’, $wp->request ) ) { wp_redirect( home_url( user_trailingslashit( ‘jobs’ ) ) ); exit; } } add_action( ‘wp’, ‘wpse_199869_wp’ ); We make sure it’s a 404, … Read more

htaccess redirect from specific urls of my site to the homepage

If you’re going to have plenty of URLs to be handled later on, you can use Simple 301 Redirects (or similar) plugin available on WP Repo. Here is the link: https://wordpress.org/plugins/simple-301-redirects/ The plugin offers options on WP dashboard instead of playing with htaccess file. I’m finding it very helpful with Woocommerce site where, sometimes I … Read more