I am trying to set up a subdomain so that it will redirect to a specific file. EG. register.mydomain.com
should show the page at www.mydomain.com/includes/register.php
but still show register.mydomain.com
in the browser.
The site is currently set up to not show extensions in the address bar eg. www.mydomain.com/register
using the htaccess file as below and this works fine.
RewriteEngine On
RewriteRule ^register$ includes/register.php
The first thing to notice here, is the files should be in same document root. This means, your .htaccess file and includes/register.php files should be in same root folder for application. You can then rewrite the rule -
RewriteEngine On
RewriteCond %{HTTP_HOST} ^register\.mydomain\.com$ [NC]
RewriteRule ^$ includes/register.php [L]
This might work, reload Apache after changing .htaccess files.