• Hello
    I am following a tutorial to have tis own login page.

    if you look at the minute 2.19, he enter https://82.241.58.241/Wordpress/login and he get a page.
    On my server, if I enter https://www.myserver.ch/login, I got an error page.

    That tutorial is a bit old and may be is due to WP version, but with last version, is possible to have page/folder login?

    In the /wp-content/themes/twentyseventeen_perso/function.php file, I also added the follwing line

    // Add by pamey
    add_action('send_headers','site_router');
    function site_router(){
    	$root = str_replace('index.php','',$_SERVER['SCRIPT_NAME']);
    //	print_r($root);
    	$url = str_replace($root,'',$_SERVER['REQUEST_URI']);
    //	print_r($url);
    	$url = explode("/",$url);
    //	print_r($url);
    	if(count($url) == 1 && $url[0] == 'login')
    	{
    		echo "LOGIN";
    		require 'tpl-login.php';
    	}
    }

    In that way, when I enter https://www.myserver.ch/login, it redirect to my tp-login.php template.

    No my problem is that https://www.myserver.ch/login return me an error, instead of a page… ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • Ali Husnain

    (@alihusnainarshad)

    https://www.wpbeginner.com Ultimate guide for wordpress login page

    Moderator bcworkz

    (@bcworkz)

    The send_headers action is a poor choice for outputting content. It could cause “headers already sent” errors. Even if it works now, it could fail when you change themes or add another plugin. If hooking send_headers and generating output is the scheme purported by the tutorial, I would seriously question its veracity.

    Have a look at https://codex.www.ads-software.com/Customizing_the_Login_Form#Make_a_Custom_Login_Page

    As it suggests, create a custom page template and call wp_login_form() on it. Add a new page based on this template called “Login”. When myserver.ch/login/ is requested, the login form appears. As shown in the article, you can add fields, change messaging, etc. to meet your needs. You can style the page with custom CSS so it appears exactly as you like.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to make my own loging page’ is closed to new replies.