WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Trouble with multisite login and redirect_to (2 posts)

  1. hertne
    Member
    Posted 1 year ago #

    I've set up a multi-site on my local machine with the following stack:

    PHP 5.3.3
    Apache/2.2.15

    When I try to navigate to a link such as:
    http://localhost/wp-multi/login?redirect_to=http://localhost/wp-multi/blog/2013/01/08/test-poll/

    which was generated using:
    wp_login_url(get_permalink())

    the redirect_do doesn't seem to carry through. The end result is that, instead of being redirected appropriately, I'm redirected to the current dashboard.

    I believe I've traced the problem down to having to do with my .htaccess and RewriteRule's. I believe that when things are being routed from /wp-multi/login? to /wp-multi/wp-login.php, $_GET['redirect_to'] is being lost.

    Any help or advice that could be given would be greatly appreciated.

    Ninja Edit: Forgot to include the relevant .htaccess information:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteRule ^wp-admin/includes/ - [F,L]
    RewriteRule !^wp-includes/ - [S=3]
    RewriteCond %{SCRIPT_FILENAME} !^(.*)wp-includes/ms-files.php
    RewriteRule ^wp-includes/[^/]+\.php$ - [F,L]
    RewriteRule ^wp-includes/js/tinymce/langs/.+\.php - [F,L]
    RewriteRule ^wp-includes/theme-compat/ - [F,L]
    
    RewriteCond %{REQUEST_METHOD} POST
    RewriteCond %{REQUEST_URI} ^(.*)wp-comments-post\.php*
    RewriteCond %{HTTP_REFERER} !^(.*).*
    RewriteCond %{HTTP_REFERER} !^http://jetpack\.wordpress\.com/jetpack-comment/ [OR]
    RewriteCond %{HTTP_USER_AGENT} ^$
    RewriteRule ^(.*)$ - [F,L]
    
    RewriteRule ^login/?$ /wp-multi/wp-login.php?60jis6g2ahs3fbtiey2fd [R,L]
    
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
    RewriteRule ^admin/?$ /wp-multi/wp-login.php?60jis6g2ahs3fbtiey2fd&redirect_to=/wp-multi/wp-admin/ [R,L]
    
    RewriteRule ^admin/?$ /wp-multi/wp-admin/?60jis6g2ahs3fbtiey2fd [R,L]
    
    RewriteRule ^register/?$ /wp-multi/wp-login.php?60jis6g2ahs3fbtiey2fd&action=register [R,L]
    
    RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
    RewriteCond %{HTTP_REFERER} !^(.*)/wp-multi/wp-admin
    RewriteCond %{HTTP_REFERER} !^(.*)/wp-multi/wp-login\.php
    RewriteCond %{HTTP_REFERER} !^(.*)/wp-multi/login
    RewriteCond %{HTTP_REFERER} !^(.*)/wp-multi/admin
    RewriteCond %{HTTP_REFERER} !^(.*)/wp-multi/register
    RewriteCond %{QUERY_STRING} !^60jis6g2ahs3fbtiey2fd
    RewriteCond %{QUERY_STRING} !^action=logout
    RewriteCond %{QUERY_STRING} !^action=rp
    RewriteCond %{QUERY_STRING} !^action=register
    RewriteCond %{QUERY_STRING} !^action=postpass
    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
    RewriteRule ^.*wp-admin/?|^.*wp-login\.php /wp-multi/not_found [R,L]
    
    RewriteCond %{QUERY_STRING} ^loggedout=true
    RewriteRule ^.*$ /wp-multi/wp-login.php?60jis6g2ahs3fbtiey2fd [R,L]
    </IfModule>
  2. hertne
    Member
    Posted 1 year ago #

    I figured it out.

    I'm using the plugin "Better WP Security", which has the ability to "Hide WordPress Backend". By turning this off and removing the re-write rules associated with the plugin, I'm able to use redirects again.

Topic Closed

This topic has been closed to new replies.

About this Topic