• seanhawkins89

    (@seanhawkins89)


    Hi, hope this post is in the right place…

    We use two registration links allowing users to register for different roles:
    /wp-login.php?action=register&utype=subscriber
    /wp-login.php?action=register&utype=contributer

    The subscriber link is the simple registration page and the contributer link contains extra fields. When a registration page fails (e-mail already in use) it is redirected to just the standard /wp-login.php?action=register page. How can I direct to the page that the request came from i.e. subscriber if that’s the page that the request from, or contributer if it came from that link?

    I’ve tried:

    function my_reg_fail($username){
    // Get the reffering page, where did the post submission come from?
    $referrer = $_SERVER['HTTP_REFERER'];
        // if there's a valid referrer
        if(!empty($referrer)){
            // redirect
            wp_redirect($referrer);
        exit;
        }
    }

    This seems to cause a problem, in IE it does nothing and in Firefox it says:

    “The page isn’t redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    This problem can sometimes be caused by disabling or refusing to accept cookies.”

    The $referrer returns the correct address if I echo it, I think it’s something to do with htaccess?

    The htaccess file contains:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /proofing/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /proofing/index.php [L]
    </IfModule>
    # END WordPress

    Where ‘proofing’ is the directory of the WordPress site. Any thoughts on this?

    Many thanks!

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Sorry, it’s not .htaccess, and I couldn’t tell you what is the problem. The .htaccess code allows permalinks to work. It has no effect on any valid server files. The !-f flag results in do not rewrite any valid server file.

    A common cause of that Firefox error message is the redirect is stuck in an infinite loop, the redirect is causing a new redirect which causes another redirect… Apparently your function is being called every time, check the conditional which calls it.

Viewing 1 replies (of 1 total)
  • The topic ‘Redirect Problem – htaccess?’ is closed to new replies.