Hi there, I do test server by installed appserv 2.4.5 that come with Apache 1.3.34 PHP 4.4.1 MySQL 5.0.16 phpMyAdmin-2.5.7-pl1 and mod_rewrite has been enabled by default. It works well until I inserted "virtualhost" to create multiple-site in my l ocalhost by inserted these lines. in apache httpd config file. (line 152) Listen 80 Listen 8080 NameVirtualHost 127.0.0.1:80 NameVirtualHost 127.0.0.1:8080 <VirtualHost 127.0.0.1:80> ServerName www.test1.com DocumentRoot H:/test1 </VirtualHost> <VirtualHost 127.0.0.2:80> ServerName www.test2.com DocumentRoot H:/test2 </VirtualHost> <VirtualHost 127.0.0.3:80> ServerName www.test3.com DocumentRoot H:/test3 </VirtualHost> What's wrong with my localhost? Please give me some suggestion.
I don't think you can use 127.0.0.2 or 127.0.0.3 - only 127.0.0.1 is a valid localhost IP address. Use different port numbers instead: <VirtualHost 127.0.0.1:80> <VirtualHost 127.0.0.1:81> <VirtualHost 127.0.0.1:82> But, if you're trying to create using virtual hosts, they should all have the same IP address and port: <VirtualHost 127.0.0.1:80> ServerName test1 DocumentRoot H:/test1 </VirtualHost> <VirtualHost 127.0.0.1:80> ServerName test2 DocumentRoot H:/test2 </VirtualHost> <VirtualHost 127.0.0.1:80> ServerName test3 DocumentRoot H:/test3 </VirtualHost> Code (markup): You will probably need to add these hostnames to your hosts file: 127.0.0.1 localhost 127.0.0.1 test1 127.0.0.1 test2 127.0.0.1 test3 Code (markup): Hope this helps (I'm not 100% sure I'm right though - can someone else verify?). Cryo.
Thank you for your replied. I do following your instruction but still see 404 error when used mod_rewrite function. Any advice? Regards,