Tech Support > Computers & Technology > subdomain redirects
subdomain redirects
Posted by obarrera on March 15th, 2006


I need help do some settings in the sports Server in order to allow sub
domains and redirect it to messages section.

For example: I need to create a wildcard subdomain that excutes a
script at a different location.

1) lets say going to this url:

http://subdomain.sports.com

this must execute a script in

http://www.sports.com/messages/goods/?goods=subdomain

2) lets say going to this url:

http://john.www.sports.com

this must execute a script in

http://www.sports.com/messages/goods/?goods=john

Thanks,
I will greatly appreciate your help

Posted by Jw on March 16th, 2006


Need a bit more info

if i go to say bob.sports.com you want it execute that script but you
want the url to still be bob.sports.com? I don't think most server side
software will allow it out of the box but you could try doing SSI
(Server Side Includes) Most webservers have this enabled.

I think there is a guide to do this on www.htmlgoodies.com (if the page
still exists)

I bet the server could be configured to allow it to execute, not sure on
the security risks on this but i bet it would be something like below.

say your path to the subdomain is
/var/www/html/subdomain

and the path to the script is
/var/www/messages/goods/

you could try calling the file as:
.../message/goods/?goods=subdomain

If you are using Apache you can use .htaccess to redirect the request.
here is a tutorial on htaccess:
http://httpd.apache.org/docs/trunk/howto/htaccess.html

I didn't see it there but what you are looking for is Redirect and or
ModRewrite (i think)

anyway i hope some of this helps

Joe

obarrera wrote:


Similar Posts