myson.mydomain.com

New to mod_rewrite? This is a good place to start.

Postby Guest » Sat Oct 27, 2001 12:58 pm

I want my son's web site to have the url myson.mydomain.com and for it to bring up the directory http://www.mydomain.com/myson. Can mod_rewrite do this? If so, how? Or is there a better way?

Thanks
Guest
 

Postby Brett » Sat Oct 27, 2001 1:29 pm

That really depends on how your hosting company handles subdomains. Most hosting companies (including [url]yohost.com[/url]) will set it up this way when you define the subdomain. If for some reason myson.mydomain.com is currently pointed to your main HTML directory, you can do something like this:

RewriteEngine on
RewriteCond %{HTTP_HOST} myson.mydomain.com
RewriteCond %{REQUEST_URI} !^/myson/
RewriteRule ^(.*) myson/$1 [L]
Brett
 
Posts: 82
Joined: Tue Jul 10, 2001 4:00 pm
Location: yohost.com


Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 22 guests

cron