WordPress.org

Support

Support » Plugins and Hacks » Redirecting the register link

Redirecting the register link

Viewing 15 replies - 1 through 15 (of 19 total)
  • Perhaps not much help. But you may try to examine the .htaccess file and modify it.

    But I warn you, every time you click save or update setting button on Better WP Security, this plugin will alter it to its default.

    I have tried the .htaccess but I can’t figure it out, must be something to do with the secret key or something.

    Any ideas on the syntax? I would be at least happy to keep changing it manually until I figured out a suitable alternative.

    Here is the sample of my .htaccess

    ....
    RewriteRule ^register/?$ /wp-login.php?blablabla&action=register [R,L]
    
    RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/wp-admin
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/wp-login\.php
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/login
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/admin
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register
    RewriteCond %{QUERY_STRING} !^blablabla
    RewriteCond %{QUERY_STRING} !^action=logout
    RewriteCond %{QUERY_STRING} !^action=rp
    RewriteCond %{QUERY_STRING} !^action=register
    ....

    Note:
    blablabla is your secret key
    yoursitename.com is your website’s domain name

    You may need to change the register in this line:
    RewriteRule ^register/?$ /wp-login.php?blablabla&action=register [R,L]
    (only the first one, not the register near the end)

    Also the register in this line:
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register

    I’m not expert in .htaccess file, but it does seem the 2 lines are what you need to edit.

    Remember, do backups before you edit the file.

    Cheers, I will give it a go.

    OK, so I still am unsure.

    My file looks similar to yours.

    I tried switching:

    RewriteRule ^register/?$ /wp-login.php?blablabla&action=register [R,L]

    to

    RewriteRule ^wp-login.php?blablabla&action=register/?$ /register [R,L]

    and it did nothing. I want mysite.com/wp-login.php?blablabla&action=register to redirect to mysite.com/register

    Did I do it wrong? Obviously I did 🙂

    The default recommended register link is register. For example you want to change it to newmember.

    So, this is the original:

    ...
    RewriteRule ^register/?$ /wp-login.php?blablabla&action=register [R,L]
    ...

    You need to change that to:

    ...
    RewriteRule ^newmember/?$ /wp-login.php?blablabla&action=register [R,L]
    ...

    You can’t simply delete, you should change. From your example, you deleted the word: register. It’s not correct.

    RewriteRule ^register/?$ /wp-login.php?blablabla&action=register [R,L]

    That was only the first you need to change. Then you should change this too:

    ...
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register
    ...

    Became:

    ...
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/newmember
    ...

    Isn’t that making newmember go to /wp-login.php?blablabla&action=register

    I want to make /wp-login.php?blablabla&action=register go to newmember (which in my case is a page called register)

    Oppositely as what you think. It makes the default wordpress /wp-login.php?blablabla&action=register can be accessed using the newmember link.

    Try it. I can’t be sure to say I’m correct. But at least I believe so.

    Yes. However I do not want to access that page. Instead of accessing that page I want to access mysite.com/register because it has a custom registration form on it 🙂 I do not want people to be able to access the generic wordpress registration form at all.

    Okay, maybe we should try something else.

    You said you have custom register link. Let’s say it is: newmember.

    You need to tell your .htaccess not to block it. I see here could be the place:

    RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/wp-admin
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/wp-login\.php
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/login
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/admin
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register
    RewriteCond %{QUERY_STRING} !^blablabla
    RewriteCond %{QUERY_STRING} !^action=logout

    You may need to add this new line above RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register:

    ...
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/newmember
    RewriteCond %{HTTP_REFERER} !^(.*)yoursitename.com/register
    ...

    Sorry, I misunderstood your meaning previously.

    Did it work?

    You said you’re having A TON of trouble. What was the error message? Did you try to disable this Better WP Security and see the redirection work?

    Thanks I really appreciate your help. I am going to disable that function of the wp security plugin for the moment till my head stops hurting 😉

    It’s me the one that should say sorry. Trying to help but make thing worse and hurt your head.

    OK, so this is what I have. I will be essentially copying and pasting what is sent back (minus the obvious changes of security key etc).

    OUTCOME: To have the register link on the login page point to my custom registration form located at mysite.com/register.

    Many thanks to whomever helps out with this.

    ———————————————————–

    RewriteRule ^mysite-login/?$ /wp-login.php?SECRET_KEY [R,L]

    RewriteCond %{HTTP_COOKIE} !^.*wordpress_logged_in_.*$
    RewriteRule ^mysite-admin/?$ /wp-login.php?SECRET_KEY&redirect_to=/wp-admin/ [R,L]

    RewriteRule ^mysite-admin/?$ /wp-admin/?SECRET_KEY [R,L]

    RewriteRule ^mysite/?$ /wp-login.php?SECRET_KEY&action=register [R,L]

    RewriteCond %{SCRIPT_FILENAME} !^(.*)admin-ajax\.php
    RewriteCond %{HTTP_REFERER} !^(.*)com/wp-admin
    RewriteCond %{HTTP_REFERER} !^(.*)com/wp-login\.php
    RewriteCond %{HTTP_REFERER} !^(.*)com/mysite-login
    RewriteCond %{HTTP_REFERER} !^(.*)com/mysite-admin
    RewriteCond %{HTTP_REFERER} !^(.*)com/mysite
    RewriteCond %{QUERY_STRING} !^SECRET_KEY
    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 /not_found [R,L]

    RewriteCond %{QUERY_STRING} ^loggedout=true
    RewriteRule ^.*$ /wp-login.php?SECRET_KEY [R,L]

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Redirecting the register link’ is closed to new replies.