|
|
Question : Apache .htaccess subdomains ?
|
|
I need .htaccess file that would allow me to access my site with any subdomain. For example if i type sub1.site.com or sub2.site.com... that show me file sub1.txt or sub2.txt.. but i i want that subdomain stays the same.
example:
http://subb1.site.com/ to show sub1.txt without redirection to sub1.txt, so http://subb1.site.com/ must stay in link bar.
Thank you !
|
Answer : Apache .htaccess subdomains ?
|
|
> if i type sub1.site.com or sub2.site.com... that show me file sub1.txt or sub2.txt.
You'll need mod_rewrite for that
RewriteEngine on RewriteCond %{HTTP_HOST} !^www\. RewriteCond %{HTTP_HOST} ^([^.]+)\.site\.com RewriteRule ^$ /%1.txt [L]
|
|
|
|