http://sub.domain.com rewrite to http://www.sub.domain.com

Using a single web hosting account to host multiple sites

http://sub.domain.com rewrite to http://www.sub.domain.com

Postby adriansi7 » Sun Sep 24, 2006 11:46 am

i have done this and works:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(sub)\.domain\.com$ [NC]
RewriteRule !^sub(/.*)?$ /sub%{REQUEST_URI}[QSA,L]




but i want also to work with www.sub.domain.com

So how can i get this to work as http://sub.domain.com ( works now ) , and also http://www.sub.domain.com (goal) simultanously without redirect one to other?
adriansi7
 
Posts: 5
Joined: Sun Sep 24, 2006 11:36 am

Postby richardk » Sun Sep 24, 2006 3:10 pm

You want both to work?
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?sub\.domain\.com$ [NC]
RewriteRule !^sub(/.*)?$ /sub%{REQUEST_URI} [QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby adriansi7 » Mon Sep 25, 2006 4:08 am

yes i want them both to work , tryed your code but still doesn`work . Do i have to register a new sub : www.sub?
adriansi7
 
Posts: 5
Joined: Sun Sep 24, 2006 11:36 am

Postby richardk » Mon Sep 25, 2006 9:18 am

Yes you need DNS for the www subdomain.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby adriansi7 » Tue Sep 26, 2006 4:29 am

doesn`t work to create sub named www.sub :(
adriansi7
 
Posts: 5
Joined: Sun Sep 24, 2006 11:36 am

Postby richardk » Tue Sep 26, 2006 7:09 am

What happens when you go to the www subdomain? Got a link? What ahppens when you go to the www subdomain with no mod_rewrite?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby adriansi7 » Tue Sep 26, 2006 9:10 am

Appears Google:

Your search - www.poze.ntvdancri.ro - did not match any documents.

Suggestions:
Make sure all words are spelled correctly.
Try different keywords.
Try more general keywords.
adriansi7
 
Posts: 5
Joined: Sun Sep 24, 2006 11:36 am

Postby richardk » Tue Sep 26, 2006 12:31 pm

Why are you using Google?

You don't have DNS for that subdomain: http://www.dnsstuff.com/tools/lookup.ch ... .ro&type=A
Answer:
No A records exist for www.poze.ntvdancri.ro, and www.poze.ntvdancri.ro does not exist. [Neg TTL=300 seconds]

Details:
xms.homelinux.com. (an authoritative nameserver for ntvdancri.ro.) says that there are no A records for www.poze.ntvdancri.ro, and that the hostname www.poze.ntvdancri.ro does not exist.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 82 guests

cron