I would like to rewrite requests to a subdomain to a sub-folder on the site in question.
The subdomain is dev.my-domain.co.za
(yes, it has a hyphen in it)
The folder it needs to internally reference is my-domain.co.za/dev.my-domain.co.za
I don't want it to redirect, but to rewrite, so that the user just sees http://dev.my-domain.co.za/...
I found various examples here on StackOverflow, but I was unable to get them to work in my scenario. So I figure it's best I ask and explain my exact situation.
There is going to be a Wordpress site in the sub-folder. I am assuming it is okay to call it via a sub-domain (if you happen to know, please advise). Otherwise, if there are issues, I can ask that question separately in a WP related forum.
So far I tried this:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^dev\.domesticflights\-southafrica\.co\.za.*$
RewriteRule (.*) dev\.domesticflights\-southafrica\.co\.za/$1 [L]
Which is my attempt to apply this (from here) to my scenario
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^(www\.)?[^.]+\.example\.com.*$
RewriteRule (.*) myfolder/$1 [L]
I tried adapting many other examples, but none work in my scenario.