I have a wordpress site with its own .htaccess automatically generated (because I’m using permalinks), than, my web-admin has configured apache to redirect any third level domain to my site, ie :
http://lol.example.com
redirects to http://example.com
and than .htaccess
with permalinks rules does the rest.
Now I want to write a rule in the .htaccess
file that, when a user types a specific third level domain, redirects to a specific subfolder of my site, ie:
http://sprock.example.com/
redirects to http://example.com/mysprockfolder/
I know my question might sound weird, but I’ve never done this before so I’m quite confused.
Solved with that regex in my
.htaccess
:Right before this comment (just in case you have WordPress installed):
I’ve added the following:
with a 302 redirect, everything is good!
it would be much easier for you to just go to your ftp manager and make a subdomain forward to a link. Or, you can make a redirect using php.
when redirecting make sure to add the
http://www.
or it will think you want to redirect to a part of your page on the site, also make sure that your subdomain has its own folder with its own files and images.