I wouldn't bother trying to move the default xampp htdocs directory, it will probably cause more problems then it's worth. Instead you should create a virtual host. That way you can specify as many hosts as you want and where you want the files to be on the drive.
I have xampp installed in: C:\xampp
And my vhosts are in: C:\home\hostname\public_html
Because on my real server, the linux directory layout is:
/home/hostname/public_html
Where "hostname" is the first eight characters of the actual host name.
"www.somewebsite.com" would have a path like (on bluehost, powweb, etc):
/home/somewebs/public_html/
So I would make a vhost on my drive like:
C:\home\somewebs\public_html\
Open w/ notepad: C:\xampp\apache\conf\httpd.conf
Change:
- # Virtual hosts
-
Include conf/extra/httpd-vhosts.conf
To:
- # Virtual hosts
-
Include conf/extra/httpd-vhosts.conf
-
Include conf/vhosts/*.conf
Now make the folder: C:\xampp\apache\conf\vhosts
Create text file: C:\xampp\apache\conf\vhosts\00.conf
And add this:
- NameVirtualHost *:80
-
NameVirtualHost *:443
That code will get included first and it will be applied to all the other vhosts.
Using the "www.somewebsite.com" example (/home/somewebs/public_html/):
Create the text file: C:\xampp\apache\conf\vhosts\somewebs.conf
And add this:
- <VirtualHost *:80>
-
-
ServerAdmin webmaster@somewebs.com
-
ServerName www.somewebs.com
-
-
ServerAlias *.somewebs.com
-
-
DocumentRoot C:/home/somewebs/public_html
-
-
ErrorLog logs/somewebs.com-error_log
-
CustomLog logs/somewebs.com-access_log combined
-
ScriptAlias /cgi-bin/ "C:/home/somewebs/public_html/cgi-bin/"
-
-
<Directory "C:/home/somewebs/public_html/cgi-bin">
-
AllowOverride None
-
Options +ExecCGI -Includes
-
Order allow,deny
-
Allow from all
-
</Directory>
-
-
<IfModule mod_userdir.c>
-
UserDir public_html
-
</IfModule>
-
-
<Directory "C:/home/somewebs/public_html/">
-
Options Indexes FollowSymLinks Includes
-
AllowOverride All
-
Order allow,deny
-
Allow from all
-
</Directory>
-
-
-
</VirtualHost>
-
-
<VirtualHost *:443>
-
-
DocumentRoot "C:/home/somewebs/public_html"
-
ServerName www.somewebs.com:443
-
ServerAdmin webmaster@somewebs.com
-
-
ErrorLog logs/somewebs.com-error_log
-
CustomLog logs/somewebs.com-ssl_request_log ssl_combined
-
TransferLog logs/somewebs.com-access_log
-
-
ScriptAlias /cgi-bin/ "C:/home/somewebs/public_html/cgi-bin/"
-
-
SSLEngine on
-
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
-
SSLCertificateFile conf/ssl.crt/server.crt
-
SSLCertificateKeyFile conf/ssl.key/server.key
-
-
<FilesMatch "\.(cgi|shtml|phtml|php|php5|php4|php3?)$">
-
SSLOptions +StdEnvVars
-
</FilesMatch>
-
<Directory "C:/home/somewebs/public_html/cgi-bin">
-
SSLOptions +StdEnvVars
-
</Directory>
-
-
# SSL Protocol Adjustments:
-
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0
-
-
</VirtualHost>
Open w/ notepad: C:\WINDOWS\system32\drivers\etc\hosts
And below "127.0.0.1 localhost" add:
- 127.0.0.1 www.somewebs.com
-
127.0.0.1 somewebs.com
Open: C:\home\somewebs\public_html\
And create an index.html file - and in it put: "Hello World!".
In your browser, go to: www.somewebs.com
And it should say "Hello World!" on a white screen.
So now you have the real site at: www.somewebsite.com
And the virtual site at: www.somewebs.com
------------------------------------------------
To make another vhost, copy "C:\xampp\apache\conf\vhosts\somewebs.conf" to like: C:\xampp\apache\conf\vhosts\tempuser.conf
Open "tempuser.conf" and rename (in this order):
www.somewebs.com to www.tempuser.com
somewebs.com to tempuser.com
somewebs to tempuser
Then add this to the "C:\WINDOWS\system32\drivers\etc\hosts" file:
- 127.0.0.1 www.tempuser.com
-
127.0.0.1 tempuser.com
And create (Hello World!): C:/home/tempuser/public_html/index.html
Repeat as necessary.
------------------------------------------------
Now you can drag n drop html sites into the virtual host directory and view them. PHP based site will work too but if they require a database, it will have to be created and populated with phpMyAdmin before you can view the site.