title: php htaccess redirect url contains 'foldername'
body: <p>I would like to redirect, if the user using the link "<a href="http://example.com/site/" rel="nofollow">http://example.com/site/</a>" to "<a href="http://example.com" rel="nofollow">http://example.com</a>"</p>
  
  <p>I have searched and modified htaccess with many examples, but it doesn't redirects.</p>
  
  <p>I have tried with rewritecond, redirects, but doesn't redirects as desired.</p>
  
  <pre><code>RewriteCond %{HTTP_HOST} ^https\:\/\/example\.com\/site\/ [NC]
  RewriteRule ^(.*)$ https://example.com/$1 [R,L]
  
  RewriteCond %{REQUEST_URI} !^/site/
  RewriteRule ^(.*)$ https://example.com/$1 [R,L]
  
  RewriteCond %{REQUEST_URI} !^/site/.*$
  RewriteRule ^(.*)$ https://example.com/$1 [R,L]
  
  RewriteRule ^/site/(.*)$ https://example.com/$1 [L,R=301]
  </code></pre>
  
  <p>Finally i kept my htaccess like below.</p>
  
  <h2>HTACCESS CODE BELOW</h2>
  
  <pre><code>RewriteEngine On 
  RewriteCond %{HTTP_HOST} ^example\.com [NC]
  RewriteCond %{SERVER_PORT} 80 
  RewriteRule ^(.*)$ https://example.com/$1 [R,L]
  </code></pre>
  
  <p>I don't know the possible solutions to overcome such issue.
  Please assist me. Thanks in advance.</p>