Leading slash isn't matched in RewriteRule
in .htaccess
. Change your rule to:
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/folder_x/folder_y/ [NC]
RewriteRule ^ /folder_x/folder_y%{REQUEST_URI} [L]
Some other improvements I have made:
- Removed
R
flag since you wanted internal rewrite only - Added
RewriteCond
before rule to avoid rewriting URIs that already start with/folder_x/folder_y/