Redirect HTTP requests based on subdomain address without changing accessed URL?
- by tputkonen
Let's say I have a domain, www.mydomain.com.
And I ordered a new domain, abc.newdomain.com.
Both domains are hosted in the same ISP, so currently requests to either of those addresses result in the same page being shown.
I want to redirect all requests to abc.newdomain.com to folder /wp so that when users access abc.newdomain.com they would see whatever is inside folder /wp without seeing the URL change.
Questions:
How can I achieve this using .htaccess?
How can I prevent users from accessing directly /wp directory (meaning that www.mydomain.com/wp would be blocked)?