Help me virtual sub domain

Using a single web hosting account to host multiple sites

Help me virtual sub domain

Postby wannet » Thu Jul 27, 2006 11:45 pm

In .htaccess

Code: Select all
RewriteEngine On

# subdomain code
RewriteCond %{HTTP_HOST} !^(www\.)?alomaytinh\.net$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.alomaytinh\.net$ [NC]
RewriteCond %1---%{REQUEST_URI} !^(.+)---/\1(/.*)?$
RewriteRule .* /%1%{REQUEST_URI} [QSA,L]

# fix for mod_dir conflict
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?alomaytinh\.net$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.alomaytinh\.net$ [NC]
RewriteCond %1---%{REQUEST_URI} ^(.+)---//?\1(/.*)?$
RewriteRule .* %2 [R=301,QSA,L]


What's problem???
It's does not work, why? Something sonfig for httpd.config????

pls, tks.
wannet
 
Posts: 3
Joined: Thu Jul 27, 2006 11:26 pm

Postby richardk » Fri Jul 28, 2006 6:14 am

What version of Apache are you using?
What error are you getting? (What's happening?)
Do you have DNS for the subdomains?
Are all the subdomains pointed to the same document root (where the .htaccess file is)?
Have you ever used mod_rewrite before? Are you sure you're allowed to use it?

Answer all the questions.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby wannet » Sun Jul 30, 2006 8:41 pm

richardk wrote:What version of Apache are you using?
What error are you getting? (What's happening?)
Do you have DNS for the subdomains?
Are all the subdomains pointed to the same document root (where the .htaccess file is)?
Have you ever used mod_rewrite before? Are you sure you're allowed to use it?

Answer all the questions.


My Apache is: 1.3
When i try test.mydomain.com: the page cannot display
What's DNS for the subdomain???
Yes all the subdomain in document root (.htaccess in the same root)
I have ever used mod_rewirte for vitual directory (www.mydomain.com/register ==> www.mydomain.com/index.php?id=register)
wannet
 
Posts: 3
Joined: Thu Jul 27, 2006 11:26 pm

Postby richardk » Tue Aug 01, 2006 12:03 pm

What's DNS for the subdomain???

DNS is the system for getting the request to the server, if you don't have it you'll get a timeout and won't be able to connect.

When i try test.mydomain.com: the page cannot display

So you're getting a timeout? Or some other error? You need DNS, if you don't have it talk to your host. Or you could post a link to a subdomain so i can see.

I have ever used mod_rewirte for vitual directory

Is it in your root .htaccess file where you are going to put the subdomain code? If it is, post your current mod_rewrite code.

My Apache is: 1.3

Code: Select all
Options +FollowSymLinks

RewriteEngine On

# subdomain code
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?alomaytinh\.net$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.alomaytinh\.net$ [NC]
RewriteRule .* /%1%{REQUEST_URI} [QSA,L
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Mod_rewrite

Postby wannet » Tue Aug 01, 2006 10:45 pm

http://subtest.alomaytinh.net/

my mo_rewrite code:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

# subdomain code
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?alomaytinh\.net$ [NC]
RewriteCond %{HTTP_HOST} ^([^\.]+)\.alomaytinh\.net$ [NC]
RewriteRule .* /%1%{REQUEST_URI} [QSA,L
wannet
 
Posts: 3
Joined: Thu Jul 27, 2006 11:26 pm

Postby richardk » Wed Aug 02, 2006 2:25 am

You don't have any DNS for that subdomain. http://www.dnsstuff.com/tools/ping.ch?i ... aytinh.net You need to setup DNS, ask your host.

And the mod_rewrite code needs a "]" after "[QSA,L".
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 16 guests

cron