View Full Version : htaccess how to make www.subdomain paraller to subdomain?
alva
17th August 2007, 23:22
Please tell me what code is necessary to write in htaccess file to make
www.subdomain.domain.com same as subdomain.domain.com
problem is that my blog system understand only subdomain.domain.com but if user writes www by mistake system shows url error. So I'm sure there must be a code that will make www.xxx.domain.com same as xxx.domain.com for all registered domains.
falko
18th August 2007, 13:42
You must add
ServerAlias www.subdomain.domain.com
to the vhost configuration in Apache (not .htaccess). And of course, www.subdomain.domain.com must point to the correct IP address in DNS.
alva
18th August 2007, 23:10
I want this to be used for all automatically created subdomains not just for one or two. my domain is www.domain.com how to do this?! and at the same time I do not want mistake like www.www.domain.com to be the same as www.domain.com This is the only let's say subdomain that I do not want to be forwarded anywere to allow people go to the main page without problem and register for new blogs.
falko
19th August 2007, 15:51
I want this to be used for all automatically created subdomains not just for one or two. my domain is www.domain.com how to do this?!
You can add as many subdomains to the ServerAlias line as you like, e.g. ServerAlias sub1.example.com sub2.example.com sub3.example.com
and at the same time I do not want mistake like www.www.domain.com to be the same as www.domain.com This is the only let's say subdomain that I do not want to be forwarded anywere to allow people go to the main page without problem and register for new blogs.You'd have to filter that out yourself, e.g. with a script.
goitalone
8th September 2007, 01:46
I have yet to figure out or understand exactly how to make a top level subdomain work to display something other than my regular website.
For example:
I want subdomain.domain.com to display an entirely new site from a different folder, but right now this is the path to ALL of my regular site (forum) content:
D:/Web/Server/Apache2/htdocs
I am using my own domain I signed up and paid for up for at www.netfirms.com and forwarded my info to www.freedns.afraid.org to get my domain to work on my webserver from home (at least I think I had to do it that way...still not sure)
At Netfirms, I can change the A records, CNAME's etc. there but I am not sure if I need to configure anything at Netfirms as well as at freedns.org, or just at freedns.org...(or if I can do it all from Netfirms)
I don't know exactly what I am doing wrong, but I can't seem to get it to work right.
I made a domain test subdomain name with A record at freedns (CNAME wouln't work)
gay.sda-n-friends.com
I added this to Apache:
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /gay
ServerName gay.sda-n-friends.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
I made a folder for a new site.
Tried playing around with .htaccess configurations since that is new to me too and that didn't help.
Scoured the net looking for an answer, couldn't quite find one that worked for me....nothing worked.
Can someone please help me figure this out?
Thanks alot!
falko
9th September 2007, 20:55
I made a domain test subdomain name with A record at freedns (CNAME wouln't work)
gay.sda-n-friends.com
I added this to Apache:
<VirtualHost *:80>
# ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /gay
ServerName gay.sda-n-friends.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
I made a folder for a new site.
That site is working for me (or should I see different content?).
goitalone
9th September 2007, 21:42
I finally managed to figure it out, thanks!
I still have to figure out how to use .htaccess commands etc. for, if nothing more, to gain some extra knowledge.
Can I make subdomain.domain disguised as something else other than ending with my actual domains name?
Any advice or commands that you could mention of the top of your head that could be useful for .htsccess? I dunno, like maybe explin rewrite a bit to me?
falko
10th September 2007, 21:11
Any advice or commands that you could mention of the top of your head that could be useful for .htsccess? I dunno, like maybe explin rewrite a bit to me?
I think the best is to take a look here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
goitalone
10th September 2007, 22:57
Alright cool thanks!
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.