Can’t make redirect in WordPress

Try this: <?php wp_login_form( array( ‘echo’ => true, ‘redirect’ => ( is_ssl() ? ‘https://’ : ‘http://’ ) . $_SERVER[‘HTTP_HOST’] . $_SERVER[‘REQUEST_URI’], ‘form_id’ => ‘loginform’, ‘label_username’ => __( ‘Username’ ), ‘label_password’ => __( ‘Password’ ), ‘label_remember’ => __( ‘Remember Me’ ), ‘label_log_in’ => __( ‘Log In’ ), ‘id_username’ => ‘user_login’, ‘id_password’ => ‘user_pass’, ‘id_remember’ => ‘rememberme’, … 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

Redirect to parent page if child does not exist

If you want to do this in your .htaccess file to ensure an early redirect, the method is as follows. First check if the page does not exist using the rewrite condition: RewriteCond %{REQUEST_FILENAME} !-f Next comes the rewrite rule for the page that does not exist RewriteRule ^/au/location1/(.*)$ http://example.com/au/location1/ [L] Putting this all together: … Read more