title: show error message if user try to go to link directly with out logged in
body: <p>I am trying to show error message if user try to go to link directly with out logged in.</p>
  
  <p>For example:here is my URL: www.xxxx.com/custom/login.php</p>
  
  <p>when user used this URL they will redirect to my custom portal.</p>
  
  <p>and i have another URL like www.xxx.com so it will take them to another portal.</p>
  
  <p>So now what i did in my custom portal is i gave one button called upload in dashboard for admin once they logged in if they click on the button they will redirect to www.xxx.com.</p>
  
  <p>Here is my button code:</p>
  
  <pre><code>&lt;ul class="nav navbar-nav"&gt;
  
                  &lt;?php
                  if ($_SESSION['username'] == 'admin') {
                      ?&gt;
                      &lt;li   style="border-left: 7pt solid #B1B3B3;padding: 0px;" &gt;&lt;a  href="../"&gt;Upload &lt;/a&gt;
              &lt;?php
                  }
                  ?&gt;
  
  
              &lt;/ul&gt;
  </code></pre>
  
  <p>so what i am trying to do is if they try to remove the custom/login.php from URL and try to access the www.xxx.com i want to show some error message</p>
  
  <p>if they try to go from dashboard i don't want to restrict them.</p>
  
  <p>Can anyone help me how to do that</p>
  
  <p>Thanks in advance.</p>