Dear all, I'm a newbie in Apache server. I've 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 and works very well. But I've found problem with mod_rewrite when I tried to inserted virtualhost in Apache httpd config file by add these lines. 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> Code (markup): Now I can use different IP to call my website by enter http://127.0.0.1 http://127.0.0.2 http://127.0.0.3 for call each site but mod_rewrite doesn't work with this config. I'm feeling that I did something wrong but I don't know which. Please give me some suggestion to get apache with virtualhost work with Apache mod_rewrite. Regards, Sxperm
Put the mod_rewrite code at domain.com/.htaccess and see if that works. If it doesn't, I don't know what would.
Thank you for your help, Nintendo. However, .htaccess file does still exists and mod_rewrite worked very well before I put those codes in Apache httpd config file to created multiple-sites localhost. If I misunderstand something please give me some suggestion or example of coding to put them on. Regards, Sxperm