0

I'm trying to set up a sub domain for development on a windows server and am having problems setting the correct details in the httpd.ini file and hoped someone could help.

I have set up the subdomain

http://dev.website.com

The files that I want to use for this subdomain are on the server in a folder called development

http://www.website.com/development

in the directory structure they are in

/htdocs/development

What do I need to add the the httpd.ini file to point the http://dev.website.com to the files located in the /htdocs/development folder on the server?

migrated from stackoverflow.com Jun 18 '10 at 5:36

This question came from our site for professional and enthusiast programmers.

1

Aren't vhosts supposed to be implemented as vhosts instead of rewrites?

http://httpd.apache.org/docs/1.3/vhosts/examples.html

dev.website.com /htdocs/development

<VirtualHost *:80>
DocumentRoot /htdocs
ServerName www.website.com
ServerAlias website.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /htdocs/development
ServerName dev.website.com
ServerAlias www.dev.website.com
</VirtualHost> 
0

Yes its ISAPI rewrite I think.

@Jeff - thanks for the link i'll take a look and try to work it out.

Ok so I tried adding the following to the httpd.ini file and its not working. Is this what i need to be doing?

#Fix missing trailing slash char on folders RewriteRule ^([^.?]+[^.?/])$ $1/ [R]

#Fix duplicate content problem

RewriteCond %{HTTP:Host} .*myserver.com$ [NC] RewriteRule ^/subdomain/([^/?]+)(.+) http://$1.myserver.com$2 [NC,R=301]

#Map requests to the folders

RewriteCond %{HTTP:Host} ^(?!www.)([^.]+).myserver.com [NC] RewriteRule (.*) /subdomain/%1$1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy