Reputation: 541
I want to show pages on a subdomain test.mysite.com
, I have several folders on this subdomain, so if someone goes to test.mysite.com/siteone
it will show you the site on that folder.
How do I configure the .htaccess file? I have the following code, which I found in some questions but it doesn't work:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?url=$1 [QSA,L]
</IfModule>
Upvotes: 2
Views: 680
Reputation: 1246
".htaccess files provide a way to make configuration changes on a per-directory basis." http://httpd.apache.org/docs/2.2/howto/htaccess.html
When a user fires a request in the browser, it walks all the way down: 1 server computer 2 apache service 3 (v)host configuration (via http.conf, which is preloaded into apache service) 4 directory configuration (which is loaded on demand)
so, nope, you cannot configure vhosts in .htaccess, because it is out of reach
if you have access to the http.conf or subsequent include files, just look at http://httpd.apache.org/docs/current/vhosts/examples.html
Upvotes: 2