title: Not able to redirect to quotes.php using .htaccess
body: <p>I have three pages index.php,author.php and quotes.php
  In index.php I have given reference of author.php and in author.php I have given reference of quotes.php. 
  I am able to redirect to author.php but not able to redirect to quotes.php here is my code of all three files.
  Even though the reference given to quotes.php.both the time file is redirecting to author.php. 
  help will be appreciated. </p>
  
  <pre><code> index.php
  
   &lt;!DOCTYPE html&gt;
   &lt;html&gt;
   &lt;title&gt;Quotes&lt;/title&gt;
   &lt;head&gt;
   &lt;style&gt;
   .dec {
   text-align:center;
   background-color: #000;
   background-image: linear-gradient(to bottom,#383838,#080808);
   border: 1px solid #000;
   min-height: 30px;
   padding-bottom: 3px;
   padding-top: 12px;
   }
   .dec a{
   color:white;
   text-decoration:none;
   }
    a:hover{
    color:grey;
    text-decoration:underline;
   }
  table a{color:inherit;text-decoration:none;}
  table a:hover{text-decoration:underline;}
   &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div class ="dec"&gt;
  &lt;?php
   $chars = range('a', 'z');
   foreach($chars as $eachChar){
   echo '&lt;a      href="http://localhost/quotes/authors/'.$eachChar.'.html"&gt;'.strtoupper($eachChar ).'&lt;/a&gt;&amp;nbsp;&amp;nbsp;';
   }
   ?&gt;
   &lt;/div&gt;
   &lt;?php include_once('dbconnect.php'); ?&gt;
   &lt;?php 
  
    $GetChR=isset($_REQUEST['authchar'])?$_REQUEST['authchar']:'a';
    $query= "SELECT * FROM `table2` WHERE `col2` like      '".$GetChR."%'";//.$GetChR."%'";
   $dd = mysqli_query($con,$query);
  
  
    if($dd === FALSE) { 
    die(mysqli_error($con)); // TODO: better error handling
     }
    $output='';
    $count=1;
    $NothingFound=true;
    while($row = mysqli_fetch_array($dd))
    {
    $NothingFound=false;
    $output .='&lt;tr&gt;&lt;td style="width:3%;"&gt;'.$count.'.&lt;/td&gt;&lt;td style="width:97%;"&gt;';
     $output .='&lt;a  href="http://localhost/quotes/authors/'.$GetChR.'/'.$row['friendly_url'].'.html" &gt;';
    $output .=$row['col2'].'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;';//here I  have given link so that author.php should redirect and it is working fine than what  is the  mistake in below link why it is not redirecting to quotes.php
    $count++;
      } 
      if($NothingFound){
      $output .='&lt;tr&gt;&lt;td&gt;Nothing Found.&lt;/td&gt;&lt;/tr&gt;';
       }
       ?&gt;
        &lt;table border="5" cellpadding="5" cellspacing="0" style="border-      collapse: collapse" bordercolor="#808080" width="100&amp;#37;" id="AutoNumber2"   bgcolor="white"&gt;
         &lt;tr&gt;&lt;td width=100 colspan="2"&gt;&lt;strong&gt;Author Name&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
         &lt;?php echo  $output; ?&gt;
         &lt;/table&gt;
         &lt;/body&gt;
         &lt;/html&gt;
  </code></pre>
  
  <p>author.php</p>
  
  <pre><code>     &lt;!DOCTYPE html&gt;
       &lt;html&gt;
       &lt;title&gt;Quotes&lt;/title&gt;
       &lt;head&gt;
       &lt;style&gt;
       .dec {
        text-align:center;
        background-color: #000;
        background-image: linear-gradient(to bottom,#383838,#080808);
        border: 1px solid #000;
        min-height: 30px;
        padding-bottom: 3px;
        padding-top: 12px;
         }
        .dec a{
         color:white;
         text-decoration:none;
          }
          a:hover{
          color:grey;
          text-decoration:underline;
          }
          table a{color:inherit;text-decoration:none;}
          table a:hover{text-decoration:underline;}
          &lt;/style&gt;
          &lt;/head&gt;
          &lt;body&gt;
          &lt;div class ="dec"&gt;
          &lt;?php
          $chars = range('a', 'z');
          foreach($chars as $eachChar){
          echo '&lt;a   href="http://localhost/quotes/authors/'.$eachChar.'.html"&gt;'.strtoupper($eachChar              ).'&lt;/a&gt;&amp;nbsp;&amp;nbsp;';
            }
            ?&gt;
            &lt;/div&gt;
            &lt;?php include_once('dbconnect.php'); ?&gt;
            &lt;?php 
              $authorname=isset($_REQUEST['authorname'])?      $_REQUEST['authorname']:'';
               $query= "SELECT table2.col2 AS a,table1.col2 AS b, table1.col1    AS c, table1.q_url AS d FROM table2, table1 WHERE table2.col1 = table1.col4 AND    table2.friendly_url= '".$authorname."'";
               $dd = mysqli_query($con,$query);
               if($dd === FALSE) { 
               die(mysqli_error($con)); // TODO: better error handling
                }
                $output='';
                $Authorname='';
                $count=1;
                while($row = mysqli_fetch_array($dd))
                {
                 $Authorname =$row['a'];
                 $output .='&lt;tr&gt;&lt;td style="width:3%;"&gt;'.$count.'.&lt;/td&gt;&lt;td   style="width:97%;"&gt;';
                 $url = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
                 $url=explode('/',$url);
                 $output .='&lt;a     href="http://localhost/quotes/authors/'.$url[5].'/'.$row['d'].'.html"&gt;';
                 $output .=$row['b'].'&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;';//here I  have given so that qoutes.php should redirect but it is not. is there any  mistake
                 $count++;
                 }
                 ?&gt;
                 &lt;table border="5" cellpadding="5" cellspacing="0"   style="border-collapse: collapse" bordercolor="#808080" width="100&amp;#37;"  id="AutoNumber2" bgcolor="white"&gt;
                &lt;tr&gt;&lt;td width=100 colspan="2"&gt;&lt;strong&gt;&lt;?php echo $Authorname;   ?&gt; Quotes&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
                &lt;?php echo  $output;?&gt;
                &lt;/table&gt;
                &lt;/body&gt;
                &lt;/html&gt;
  </code></pre>
  
  <p>quotes.php</p>
  
  <pre><code>       &lt;!DOCTYPE html&gt;
         &lt;html&gt;
         &lt;title&gt;Quotes&lt;/title&gt;
         &lt;head&gt;
         &lt;style&gt;
         .dec {
          text-align:center;
          background-color: #000;
          background-image: linear-gradient(to bottom,#383838,#080808);
          border: 1px solid #000;
          min-height: 30px;
          padding-bottom: 3px;
          padding-top: 12px;
           }
          .dec a{
           color:white;
           text-decoration:none;
            }
           a:hover{
           color:grey;
           text-decoration:underline;
           }
           table a{color:inherit;text-decoration:none;}
           table a:hover{text-decoration:underline;}
           &lt;/style&gt;
           &lt;/head&gt;
           &lt;body&gt;
           &lt;div class ="dec"&gt;
           &lt;?php
           $chars = range('a', 'z');
           foreach($chars as $eachChar){
           echo '&lt;a   href="http://localhost/quotes/'.$eachChar.'.html"&gt;'.strtoupper($eachChar).'&lt;/a&gt;&amp;nbsp;&amp;nbsp;';
           }
           ?&gt;
           &lt;/div&gt;
           &lt;?php include_once('dbconnect.php'); ?&gt;
           &lt;?php 
           $qname=isset($_REQUEST['qname'])?$_REQUEST['qname']:'';
           $query= "SELECT col2 FROM  table1 WHERE q_url ='".$qname."'";
           $dd = mysqli_query($con,$query);
           if($dd === FALSE) { 
           die(mysqli_error($con)); // TODO: better error handling
           }
           $output='';
           $Authorname='';
           $count=1;
           while($row = mysqli_fetch_array($dd))
           { 
            $output .='&lt;tr&gt;&lt;td style="width:3%;"&gt;'.$count.'.&lt;/td&gt;&lt;td  style="width:97%;"&gt;&lt;p&gt;'.$row['col2'].'&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;';
            $count++;
            }
            ?&gt;
            &lt;table border="5" cellpadding="5" cellspacing="0" style="border-  collapse: collapse" bordercolor="#808080" width="100&amp;#37;" id="AutoNumber3"   bgcolor="white"&gt;
            &lt;tr&gt;&lt;td width=100 colspan="2"&gt;&lt;strong&gt;&lt;?php echo $Authorname; ?&gt;   Quotes&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;
            &lt;?php echo  $output; ?&gt;
            &lt;/table&gt;
            &lt;/body&gt;
            &lt;/html&gt;
  </code></pre>
  
  <p>.htaccess</p>
  
  <pre><code>      AddDefaultCharset utf-8
        Options +FollowSymlinks -Indexes
        RewriteEngine on 
        RewriteRule ^authors/([^/]*)\.html$ /quotes/index.php?authchar=$1 [L]
        RewriteRule ^authors/([^/]*)/([^/]*)\.html$ /quotes/author.php?  authchar=$1&amp;authorname=$2 [L]
        RewriteRule ^authors/([^/]*)/([^/]*)/([^/]*)\.html$ /quotes/quotes.php?  authchar=$1&amp;authorname=$2&amp;qname=$3 [L]
  </code></pre>