Redirect non-existing folder to subdomain
I want to redirect all users that go to http://www.coolcherrycream.com/kinks/ to http://fan.coolcherrycream.com/kinks/ but the /kinks/ folder does not exist and there are no files in it -- the content I want them to see is actually in /fan/kinks/.
This code works to redirect everything in http://www.coolcherrycream.com/fan/ to http://fan.coolcherrycream.com/
So by that logic, I think this code should work to achieve what I want:
However, it looks like I need to add just a little something to the second code because the /kinks/ folder does not actually exist in the main directory. What exactly is this little something?
This code works to redirect everything in http://www.coolcherrycream.com/fan/ to http://fan.coolcherrycream.com/
- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?coolcherrycream.com$
RewriteRule ^fan/?(.*)$ http://fan.coolcherrycream.com/$1 [R,L]
So by that logic, I think this code should work to achieve what I want:
- Code: Select all
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?coolcherrycream.com$
RewriteRule ^kinks/?(.*)$ http://fan.coolcherrycream.com/kinks/$1 [R,L]
However, it looks like I need to add just a little something to the second code because the /kinks/ folder does not actually exist in the main directory. What exactly is this little something?