Reputation: 678
I know it should be simple. But always can't get it right. With the following, I can redirect example.com/abc into example.com/home/abc but not example.com/ to example.com/home
RewriteCond %{HTTP_USER_AGENT} ^.*Chrome.*
RewriteRule ^([^/]+)/?$ home/$1
How can I redirect the / as well?
Upvotes: 1
Views: 157
Reputation: 72971
If you want to redirect everything from Chrome
to be under the home/
subdirectory, then try the following, it will match anything or nothing, and append it after home/
RewriteCond %{HTTP_USER_AGENT} ^.*Chrome.*
RewriteRule ^(.*)$ home/$1
Upvotes: 1