subdomain and subfolder .htaccess

124 views Asked by At

I would honestly appreciate any input, I have beent rying to do this for 2 days! I have 2 servers, one is my webserver w/Plesk running on a Digital Ocean droplet - another running a game server.

I was wondering if it's possible to use a sub-domain on my droplet and redirect to a sub-folder in /var/www/html/somefolder on my game server. I currently have my sub.domain.com configured with an A record to my game server's IP.

My question is, how can I make use of my .htaccess files to make this happen?

1

There are 1 answers

0
RundleSG On BEST ANSWER

I've found a solution in case anyone else comes across this issue :D

RewriteEngine on
RewriteCond %{HTTP_HOST} ^subdomain\.yourdomain\.com
RewriteRule ^(.*)$ http://www\.yourdomain\.com/subdomain/$1 [L]