I have searched a lot but none of the answers I found did the trick. Basically I have a domain (example.com) but my website is in a subvolder(v4)
I have done it so that when people type in www.example.de they get redirected to www.example.de/v4/ which is what I wanted, but my client doesn't want people to see the /v4/ part in the URL.
I have two .htaccess files, the one in the root is:
RewriteEngine on
RewriteRule ^$ /v4/
RewriteCond %{HTTP_HOST} ^(www.)?example.de$
RewriteCond %{REQUEST_URI} !^/v4/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /v4/$1
RewriteCond %{HTTP_HOST} ^(www.)?example.de$
RewriteRule ^(/)?$ /v4/index.php [L]
The one in the /v4 subfolder is:
RewriteBase /v4/
RewriteRule ^v4/(.+)$ $1 [L,NC,R]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /v4/index.php [L]
RewriteRule ^v4/(.+)$ $1 [L,NC,R]
I would really appreciate any help in making the /v4/ in the URL invisible, thanks in advance