Rewrite rule for subdomains
<p>Is it possible to use .htaccess for a subdomain to point to a file on the main domain?
I have example.com as a main domain and created subdomains: one.example.com, two.example.com, etc through DirectAdmin. The subdomains should point to app.php on the main domain but in the url the subdomain should persist.</p>

<p>So navigating to one.example.com should be pointing to app.php which lives in the main domain example.com, but the url should still show one.example.com</p>

<p>I have looked and tried a lot of the rewrite rules found on <a href="https://stackoverflow.com/questions/10642426/htaccess-rewrite-subdomain-to-directory">.htaccess rewrite subdomain to directory</a> and elsewhere.
Currently I have this rewrite rule in a .htaccess file in the subfolder of the subdomain:</p>

<pre><code>RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com
RewriteRule ^(.*)$ http://example.com/app.php$1 [L,NC,QSA]
</code></pre>

<p>This redirects and changes the url to example.com/app.php while I would like the url to show the subdomain: one.example.com/whatever</p>

<p>Is it possible to do this with .htaccess ,or is there maybe even a better way to do this?</p>