Here is a little something I did to make the subdomain creation for LOCALHOST.
MAKE SURE TO DO BACKUP OF YOUR FILES BEFORE YOU EDIT THEM!
############
STEP 1
############
create a folder called 'subdomains'
in C:/WAMP/apache2/conf/
############
STEP 2
############
In WAMP enable the 'vhost_alias_module'
open httpd-vhost.conf and edit to look like below or delete all the content but not the file itself.
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:[
httpd.apache.org];
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
############
STEP 3
############
Next open wampmanager.ini and add this to the
[Menu.Left]
Type: separator; Caption: "Localhost Subdomains"
Type: submenu; Caption: "Subdomain directories"; SubMenu: subdomain_dir; Glyph: 3
Once you have done that you need to add this to the very bottom of the wampmanager.ini
[add_subdomain]
Action: run; FileName: "G:/WAMP/php/php.exe";Parameters: "-c . ../scripts/add_subdomain.php";WorkingDir: "G:/WAMP/php"; Flags: waituntilterminated
Action: service; Service: wampapache; ServiceAction: restart;
Action: resetservices
Action: readconfig;
[subdomain_dir]
Type: separator; Caption: "Subdomain directories"
Type: item; Caption: "Add an subdomain"; Action: multi; Actions: add_subdomain;Glyph : 8
Type: separator
;add_subdomain
;add_menu_subdomain
;add_delete_subdomains
Save the file
############
STEP4
############
Now Save the next peice of code as add_subdomain.php and save it to your C:/WAMP/scripts/ folder
Make these change to your resepctive paths for this script
$httpconf_file = 'C:/WAMP/apache2/conf/extra/httpd-vhosts.conf';
$wampserverini_file = '../wampmanager.ini';
$conffile_dir = 'C:/WAMP/apache2/conf/subdomains/';
open this file and save
[www.btt-scripts.com]Save the file.
############
STEP 5
############
Now Save the next peice of code as delete_subdomain.php and save it to your C:/WAMP/scripts/ folder
Edit this part of the code below to your respective paths
$conffile_dir = 'C:/WAMP/apache2/conf/subdomains/';
$wampserverini_file = '../wampmanager.ini';
$httpdconf_file = 'C:/WAMP/apache2/conf/extra/httpd-vhosts.conf';
open this file and save
[www.btt-scripts.com]Save file after you configure the lines at the top.
* * * * * * * * CONTINUED ON NEXT POST * * * * * * * *
Post Edited (04-10-07 22:56)