title: My .htaccess is not redirecting to friendly urls
body: <p>Following is my  .htaccess file. It is not working.</p>
  
  <p>RewriteEngine On
            RewriteBase /</p>
  
  <pre><code>      RewriteCond %{REQUEST_FILENAME} -f [OR]
        RewriteCond %{REQUEST_FILENAME} -d 
        RewriteCond %{REQUEST_FILENAME}\.php -f
        RewriteRule ^ - [L]
  
        RewriteRule ^friends/([\w-]+)/?$ /friends.php?username=$1 [L,QSA]
        RewriteRule ^followers/([\w-]+)/?$ /followers.php?username=$1 [L,QSA]
        RewriteRule ^settings/([\w-]+)/?$ /settings.php?username=$1 [L,QSA]
        RewriteRule ^messages/([\w-]+)/?$ /chat.php?message_username=$1 [L,QSA]
  
        RewriteRule ^following/([\w-]+)/?$ /following.php?username=$1 [L,QSA]
        RewriteRule ^following/([\w-]+)/([0-9]+)/?$ /following.php?username=$1&amp;page=$2 [L,QSA]
        RewriteRule ^followers/([\w-]+)/?$ /followers.php?username=$1 [L,QSA]
        RewriteRule ^followers/([\w-]+)/([0-9]+)/?$ /followers.php?username=$1&amp;tpage=$2 [L,QSA]
        RewriteRule ^explore/([\w-]+)/?$ /explore.php?username=$1 [L,QSA]
        RewriteRule ^explore/([\w-]+)/([0-9]+)/?$ /explore.php?username=$1&amp;page=$2 [L,QSA]
        RewriteRule ^photos/([\w-]+)/?$ /userphotos.php?username=$1&amp;page=$2 [L,QSA]
  
        RewriteRule ^(.*/([a-zA-Z0-9_-]+)|([a-zA-Z0-9_-]+))$ /profile.php?username=$1 [L,QSA]
  </code></pre>