I’m using a multisite and I set my site up at parentsite.com/mysite. When the logout button was clicked it worked correctly and logged the users out and brought them back to the homepage. Here’s what the code was:
<a class="logout with-icon" href="https://wordpress.stackexchange.com/questions/114049/<?php echo wp_logout_url( get_permalink() ) ?>" data-icon=""><?php _e('Log out', 'franklin') ?></a>
Then I bought a new domain name (mysite.com) for the site, installed the “WordPress MU Domain Mapping” plugin and set up the A name to point to parentsite.com/mysite. Everything works fine except now the logout button brings them to the homepage of parentsite.com with this in the url: http://parentsite.com/?dm=cd427564d8195660acb35d2669c96069&action=logout&blogid=8&k=87e709a6777fa366cd42edc1c52f1db9&t=1751394297
instead of the homepage of mysite.com.
I’ve tried changing the above code to:
<a class="logout with-icon" href="https://wordpress.stackexchange.com/questions/114049/<?php echo wp_logout_url("https://mysite.com') ?>" data-icon=""><?php _e('Log out', 'franklin') ?></a>
but that didn’t help. I’ve also tried
<a class="logout with-icon" href="https://wordpress.stackexchange.com/questions/114049/<?php echo wp_logout_url("https://parentsite.com/mysite') ?>" data-icon=""><?php _e('Log out', 'franklin') ?></a>
and
<a class="logout with-icon" href="https://wordpress.stackexchange.com/questions/114049/<?php echo wp_logout_url( home_url() ); ?>" data-icon=""><?php _e('Log out', 'franklin') ?></a>
Any ideas? This is very frustrating and embarrassing.
Thanks!
1 Answer
I asked on the WordPress MU Domain Mapping plugin support page and it turns out it was a setting in the plugin that needed to be turned off. I turned off
Redirect administration pages to site’s original domain
and it’s working now.
Thanks for your ideas and help!