Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
www.subdomain.domain.com problem!! Help
Old 03-29-2007, 01:03 PM www.subdomain.domain.com problem!! Help
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
I have a problem with my subdoamins and my .htaccess. I want my website, domain.com to go to www.domain.com, I can do that! But i also have subdoamins, and every body knows that you cant go to www.sub.domain.com. so how do i set it in htaccess NOT to go to www.sub.domain.com?
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
 
Register now for full access!
Old 03-29-2007, 04:41 PM Re: www.subdomain.domain.com problem!! Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
of course you can go to www.sub.hostname if you set DNS up accordingly or have a wildcard DNS

And if you haven't, then it won't resolve anywhere at all so you can't redirect it.

Have you tested it and does it resolve anywhere ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-29-2007, 05:19 PM Re: www.subdomain.domain.com problem!! Help
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
As far as I know, it's not ni the htaccess that you can do that.
It's in the virtual host definition of apache.

For exemple, I have the domain layouts-money.com.
It responds to www.layouts-money.com, and myspace.layouts-money.com, and www.myspace.layouts-money.com

Here is a snip of my virtual host definition:
Code:
<VirtualHost *:80>
ServerName www.myspace.layouts-money.com
ServerAlias layouts-money.com www.layouts-money.com myspace.layouts-money.com
CustomLog /var/www/layouts-money/log/access_log combined
ErrorLog  /var/www/layouts-money/log/error_log
DocumentRoot /var/www/layouts-money/htdocs
...
And my dns are set like that:

Meaning that the default A record is "layouts-money.com", and with alias to the other possibility.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 03-29-2007, 06:45 PM Re: www.subdomain.domain.com problem!! Help
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
Quote:
Originally Posted by chrishirst View Post
of course you can go to www.sub.hostname if you set DNS up accordingly or have a wildcard DNS

And if you haven't, then it won't resolve anywhere at all so you can't redirect it.

Have you tested it and does it resolve anywhere ?
Could you be mofre specific as to how i might do that?
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
Old 03-29-2007, 07:15 PM Re: www.subdomain.domain.com problem!! Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
type in the address that want to check,

If your DNS is wildcarded anything you type (other than www or the sub you have setup) in front of your hostname will resolve to the root of the site.


sub.
123456.
blah.blah.

If this is the case, only then will you need to consider people mistyping adresses.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-29-2007, 08:40 PM Re: www.subdomain.domain.com problem!! Help
The PHP Professor

Posts: 340
Name: Alex
Location: Behind You
Trades: 0
Ok so let me get this right, if i set my DNS to have a wild card, then i can use www.sub.domain.com? right?
__________________
Go Kirby! <(" . "<) (^" . "^) (>" . ")> Talkupation!
microcolt is offline
Reply With Quote
View Public Profile Visit microcolt's homepage!
 
Old 03-30-2007, 04:17 AM Re: www.subdomain.domain.com problem!! Help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yes, or you could add www.sub as an DNS alias (CNAME)
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to www.subdomain.domain.com problem!! Help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28894 seconds with 12 queries