Logout redirect to home page
add_action(‘wp_logout’,’auto_redirect_after_logout’); function auto_redirect_after_logout(){ wp_safe_redirect( home_url() ); exit; } This will do the trick.
add_action(‘wp_logout’,’auto_redirect_after_logout’); function auto_redirect_after_logout(){ wp_safe_redirect( home_url() ); exit; } This will do the trick.
Yes, I’ve dealt with this before. You have to specify a NOBLOGREDIRECT in your wp-config.php file: define( ‘NOBLOGREDIRECT’, ‘http://www.fightify.com’ ); If there’s no site, WP has to redirect visitors somewhere. By default, that’s the signup page. Adding that constant tells it where to go.
You can actually do this from inside WordPress itself, instead of needing to come up with a confusing and overengineered .htaccess fix. We can hook into the template_redirect filter, which only fires on the front-end (not in wp-admin). We then use the is_page() function to check if we’re viewing a page with the ID of … Read more
Two things wrong here: Don’t use $post->guid as an url You must exit() after using wp_redirect() (see the Codex) wp_redirect() does not exit automatically and should almost always be followed by exit. To redirect to your new post’s page: //….. code as in question $post_id = wp_insert_post($new_post); $url = get_permalink( $post_id ); wp_redirect($url); exit();
I see, when you enter a link to your page other than your home, example: http://www.michaelcropper.co.uk/contact-me www.michaelcropper.co.uk/contact-me michaelcropper.co.uk/contact-me If https:// is not in the prefix, the HTTP link loads instead. Add the following into your .htaccess in between the <IfModule mod_rewrite.c> tag: RewriteCond %{HTTPS} !=on RewriteRule ^(.*) https://%{SERVER_NAME}/$1 [R,L] If there were no additional modifications … Read more
I solved it!! here’s how: Edit your current theme’s functions.php and add following line after the opening PHP tag to disable canonical redirection. remove_filter(‘template_redirect’,’redirect_canonical’); save and exit. Restart apache2 and nginx and check with curl -I IP.
Try following If there are caching plugins installed like W3 total cache. Then purge cache first. Or may be disable them for time being Perform Search and Replace in the database for Old Site URL. You can Use this Plugin Reset Permalinks ( Dashboard >> Settings >> Permalinks ) Last but not the least. Clear … Read more
I just went and tested this (WP 3.3.1), the wordpress core will automatically do a redirect if you change the post slug, even if you change the slug from post-a to post-b and then to post-c, post-a will return a 301 to post-c. That said, the redirection plugin that Mike Jolley recommended is an outstanding … Read more
You can do that easily. You just need to specify a redirection parameter. If you are using a login link on the homepage to go to the login page, then @sisir’s solution is correct. <?php echo wp_login_url( $_SERVER[“HTTP_HOST”] . $_SERVER[“REQUEST_URI”] ); ?> If you are using a custom form on the frontpage, then inside the … Read more
Easy solution would be adding this line to your wp-config.php of your admin server code. define( ‘WP_SITEURL’, ‘http://’ . $_SERVER[‘SERVER_NAME’]); Then you can access it without modifying the database option.