The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Failurl not redirecting properly

Discussion in 'User Experience' started by Nirvash, Dec 31, 2012.

  1. Nirvash

    Nirvash Registered

    Joined:
    Dec 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I have been working on a custom webmail login page for my site, but one thing keeps being an issue.
    I can't get the failurl parameter to work properly. No matter what instead of redirecting back to the page (/https://domain/login/example/index.php) , it will default to the cPanel webmail page (/https://domain:2096/login/).

    Based off of cPanel documentation I have been using this code for the login form. And it does work to log in.
    Code:
    <div id="main">
    
    	<h1 class="cec"></h1>
    	<fieldset class="cec">
    
    		<font size="+1" color="#0000a0">Webmail Login</font> 
    		
    		<?php 
    		print "<form class=\"cec\" action=\"https://" . $_SERVER['HTTP_HOST'] . ":2096/login/\" method=\"post\">";
    		?> 
    
    		<div class="cec">
    			<label class="cec">User:</label>
    			<input type="text" name="user" class="short" id="user">
    		</div>
    		<div class="cec">
    			<label class="cec">Password:</label>
    			<input type="password" name="pass" class="short" id="pass">
    		</div>
    		
    		<?php 
    		print "<input type=\"hidden\" name=\"failurl\" value=\"http://" .  $_SERVER['HTTP_HOST'] . 
    		$_SERVER['PHP_SELF'] . "?failed=1\">"; 
    		echo "failurl is:  http://" .  $_SERVER['HTTP_HOST'] . 
    		$_SERVER['PHP_SELF'] . "?failed=1\""; //User readable, to verify url
    		?>
    		
    		<div class="cec2">
    			<label class="cec">&nbsp;</label>
    			<div class="right-div">	
    				<input type="submit" src="press this"/>
    			</div>
    		</div>
    
    	</fieldset>
    	</form>	
    </div>	

    And I have added these two lines to the "/usr/local/cpanel/failurls" file, I wasn't sure which was was proper as the documentation on failurls is a bit iffy. After adding them I ran the command "/usr/local/cpanel/startup"
    Code:
    https://domain/login/example/index.php
    https://domain/login/example/
    
    I am stumped and any help on this would be very appreciated.
     
  2. Nirvash

    Nirvash Registered

    Joined:
    Dec 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Guess I posted that in the wrong form!
     
    #2 Nirvash, Dec 31, 2012
    Last edited: Jan 1, 2013
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The file is not /usr/local/cpanel/failurls but /var/cpanel/failurls (see The failurls File).

    The format is:

    1. One URL per line
    2. Each line is new line separated.

    The other requirements are spelled out in the document I linked.
     
  4. Nirvash

    Nirvash Registered

    Joined:
    Dec 28, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    It seems the support person I talked to before referenced the wrong location.
    It is working fine now, thank you very much!
     

Share This Page