Forums

How to setup a Custom wp-signup Page With WordPress MU? (14 posts)

  1. drroot
    Member
    Posted 1 year ago #

    I followed the instructinos here:
    http://www.chriswiegman.com/2010/02/using-a-custom-wp-signup-page-with-wordpress-mu/
    and here:
    http://premium.wpmudev.org/forums/topic/wp-signupphp

    1. copy wp-signup.php to your theme.
    2. add the template name block at the top.
    3. make file path changes to wp-load.php and wp-blog-header.php like noted above
    4. go to just below where get_header is called and add
    $permalink = '';
    if( have_posts() ) {
    the_post();
    $permalink = get_permalink();
    }

    5. go through the rest of the file and replace wp-signup.php with <?php echo $permalink; ?>

    That's pretty much it. If you are in a function you need to add the global $permalink;

    Acturally, I am not quite clear about the last step mentioned above about the "permalink".

    Though there's no problem if I signup through the mainblog. But if I register through any subsite registration link, I get a blank page.

    Here's .htaccess file I have:

    ## set memory limit for cache.php
    #php_value memory_limit 256M
    
    # WP Robot Link Cloaking START
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$ wp-content/plugins/WPRobot3/cloak.php?post_id=$2&link_num=$3&cloaked_url=$0 [L]
    RewriteRule ^go/([^/]+)[/]?$ wp-content/plugins/WPRobot3/cloak.php?name=$1&cloaked_url=$0 [L]
    </IfModule>
    # WP Robot Link Cloaking END
    
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz" [L]
    
    RewriteCond %{REQUEST_URI} !^.*[^/]$
    RewriteCond %{REQUEST_URI} !^.*//.*$
    RewriteCond %{REQUEST_METHOD} !POST
    RewriteCond %{QUERY_STRING} !.*=.*
    RewriteCond %{HTTP:Cookie} !^.*(comment_author_|wordpress_logged_in|wp-postpass_).*$
    RewriteCond %{HTTP:X-Wap-Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP:Profile} !^[a-z0-9\"]+ [NC]
    RewriteCond %{HTTP_USER_AGENT} !^.*(2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800).*
    RewriteCond %{HTTP_user_agent} !^(w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-).*
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html" [L]
    </IfModule>
    # END WPSuperCache
    
    ## END WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-signup\.php(.*)$ wp-content/themes/p2/wp-signup.php$1
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    Following the instruction, I added one line above:
    RewriteRule ^wp-signup\.php(.*)$ wp-content/themes/default/wp-signup.php$1
    after RewriteBase /

    Here's the wp-content/themes/default/wp-signup.php:

    [Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

  2. Deleted both the post and the large code excerpt, per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.

  3. Remove this:

    ## END WordPress
    
    RewriteEngine On
    RewriteBase /
    RewriteRule ^wp-signup\.php(.*)$ wp-content/themes/p2/wp-signup.php$1
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    And replace it with one of these http://codex.wordpress.org/Create_A_Network#.htaccess_and_Mod_Rewrite

    Depending on if you're using subdomain or subfolders.

  4. drroot
    Member
    Posted 1 year ago #

    I use subfolders. And I did well followed the .htaccess rules given at
    http://codex.wordpress.org/Create_A_Network#.htaccess_and_Mod_Rewrite

    TO use a custom wp-signup.php page, I made one only change.
    I append the
    RewriteRule ^wp-signup\.php(.*)$ wp-content/themes/p2/wp-signup.php$1
    after
    RewriteEngine On
    RewriteBase /

    Any idea?

  5. drroot
    Member
    Posted 1 year ago #

    Here's the file of my wp-content/themes/p2/wp-signup.php
    http://wordpress.pastebin.com/BPQ2aq7d

  6. David Sader
    Member
    Posted 1 year ago #

  7. drroot
    Member
    Posted 1 year ago #

  8. Andrea_r
    team pirate
    Posted 1 year ago #

    Though there's no problem if I signup through the mainblog. But if I register through any subsite registration link, I get a blank page.

    Subsites should return you to the main page, so you missed a reference somewhere.

    Also white page = php errors.

  9. Try this

    RewriteRule ^wp-signup\.php(.*)$ /wp-content/themes/p2/wp-signup.php$1

    I think that you want to be redirected to the MAIN site, as Andrea said, but your .htaccess is doing it relatively. So you go to domain.com/subsite/<blah blah>/wp-signup.php instead of domain.com/<blah blah>/wp-signup.php

  10. drroot
    Member
    Posted 1 year ago #

    Yes. That's it. Thanks, ipstenu.

    Is it possible to do an internal redirect so that the address showing in the web-browser not contain "/wp-content/themes/p2/"?

    That means the registration page shows as:
    http://xxx.com/wp-signup.php

    Not
    http://xxx.com/wp-content/themes/p2/wp-signup.php

  11. drroot
    Member
    Posted 1 year ago #

    Another problem is that the signup page doesn't load using the customized template even after I added the following code on the top of wp-signup.php

    <?php
    /*
    Template Name: default
    */
    ?>
  12. drroot
    Member
    Posted 1 year ago #

    It simply uses the mainblog's current theme.

  13. Andrea_r
    team pirate
    Posted 1 year ago #

    It will always use the main blog's current theme, as signup should be redirecting there - even if they click on a sub blog.

    you should be making the custom signup page as a page template in the main blog's chosen theme. (which you can still make look drastically different).

  14. David Sader
    Member
    Posted 1 year ago #

    the following code on the top

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    That kind of page template(with the header you've got) must be applied as a page attribute when editing a page.

    When editing your page, select the template from the dropdown menu under "Page Attributes" meta box.

    So here's the steps I'd follow to remedy:

    You'll need to create a blank page (Dashboard->Pages->Add New), called "Signup", and apply this template you've created to it. Pay attention to the "slug" you are given when you save - that's what you'll be redirecting requests of the default wp-signup.php to.

Topic Closed

This topic has been closed to new replies.

About this Topic