I have a subfolder I want to redirect to, I want it to redirect dynamically so anytime I go to:
example.domain/about it takes me to example.domain/subfolder/about, but still shows: example.domain/aboutin the address bar
However, I don't want to have to specify a domain name so I can use it in any project. So I suppose just automatically want to declare the root domain name as a variable?
I have this working here:
RewriteRule !^subfolder/ /subfolder%{REQUEST_URI} [L,R=301]
And it doesn't require the domain name, but it still shows subfolder in the domain name.
The strategy in this answer is what I need, but minus the domain name:
RewriteEngine On
RewriteRule ^/subfolder/(.*)$ http://www.example.domain/$1 [L,R=301]
I also need it to work for both the www. and the naked domain.
R=301which is for redirecting it to thedestinationrule/, but it doesn't seem to work for any/otherpage