I was trying to redirect all direct access in my subfolder using this code
RewriteEngine on
RewriteCond %{HTTP_COOKIE} !user_cookie=[^;]
RewriteRule .* http://webhost.org/ [R=301,L]
I realise it was working only for OHP files but not for other files like HTML.
I tried to access the link to the PHP file and it works as I planned, but when I'm accessing the other file with .html
extension it does not redirect,
as if it was ignoring the condition of .htaccess
.
I'm new to .htaccess
. What am I doing wrong?
Server information:
- fresh install of Vestacp
- Apache/2.2.15 (CentOS 6 x64)