How to fix rewrite rule, so that it works also trough domain.com/path/.htaccess?
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
If rule used in domain.com/.htaccess, redirecting works fine:
www.domain.com/path/url -> domain.com/path/url
If rule used in domain.com/path/.htaccess, redirected incorrect:
www.domain.com/path/url -> domain.com/url // Why not domain.com/path/url ?
%{REQUEST_URI}provides you the full path: