How to make every request be directed to a subfolder? (HTACCESS)


I've tried several tutorials and none have worked other than index.php .

I use LOCALHOST and I intend that every request, of any type, for example:


Get redirected to the folder inside the WWW like this: /wamp/www/PASTA/(os arquivos das URLs estão aqui) .

But I need the redirect if it could be invisible, it would be perfect.

What I tried and only redirected the INDEX.PHP of the PASTA , but the other files were giving error 404.:

RewriteEngine on
RewriteCond %{HTTP_HOST} localhost [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ /pasta/$1 [L]


Here is what I used to redirect to a subdirectory. This happens invisibly and still allows orders that match an existing file:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteCond %{REQUEST_URI} !^/subdir/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /subdir/$1
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ subdir/index.php [L]
Scroll to Top