My Linux Guide

My Linux Guide

Linux tutorials and tips for root !

Apache

Apache rewrite rules

Rewrite to a folder and hide the folder name in url : RewriteCond     %{SERVER_NAME}    ^sitename.com        [NC,OR] RewriteCond    %{SERVER_NAME}    www.sitename.com    [NC] RewriteCond    %{REQUEST_URI}    !^anyfiletoexclude.php    [NC] RewriteCond    %{REQUEST_URI}    !^/foldertoredirect/    [NC] RewriteCond    (.*)        /foldertoredirect/$1 force use www RewriteCond    %{SERVER_NAME}    ^website.com$ RewriteRule    ^/(.*)        http://www.