I want to redirect all queries to mydomain.com to mydomain.com/live/. I'm already able to do that, however I have trouble with the URL displayed in the browser. I have two goals, (1) that the URL always renders with "www" in front and (2) that the sub folder "live" is not displayed in the url.
EDIT: Based on edited code by Cryo the following accomplishes my goals and also adds a trailing slash after all subfolders so that when a folder is typed in the url it's correctly forwarded to the index.html inside of it:
RewriteCond %{HTTP_HOST} !^www\.domain\.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteRule ^$ /index.html
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !\..+$
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://www.domain.com/$1/ [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/live/
RewriteRule ^(.*)$ /live/$1
Question though, when adding a trailing slash to subfolders, I assumed RewriteCond %{REQUEST_FILENAME} !-f would make it so that a slash isn't added after file names (only folders) so /subfolder/page.html would not have a trailing slash (which is what I want). However RewriteCond %{REQUEST_FILENAME} !-f seems to do nothing and RewriteCond %{REQUEST_URI} !..+$ is needed.