Forum Moderators: phranque

Message Too Old, No Replies

WAMP Configuration

Mod_rewrite Not Working

         

wellbornSun

6:36 am on Aug 15, 2007 (gmt 0)

10+ Year Member



I've installed WAMP [Apache 2.2.4 ; PHP 2.3.2 & MySQL ] on one of my computers, and the installation seemed to going fine, until I got to the part where you add Virtual Host and set up .htaccess rules in the directory.
#1
In C/windows/system32/drivers/ect/host...I set up the virtual host:
127.0.0.1 localhost
127.0.0.1 local.testone.com
#2
In the bottom of the httpd.conf, I set up 2 virtual host
NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1>
DocumentRoot "C:/wamp/www"
ServerName localhost
</VirtualHost>

<VirtualHost 127.0.0.1>
DocumentRoot "C:/wamp/www/testone.com"
ServerName local.testone.com
ErrorLog logs/testone.com_error.log
</VirtualHost>

...but when I type local.testone.com/phpinfo.php in the address bar, I get an error message "NOT FOUND" The requeested URL /phpinfo.php was not found on this server.

Any help would be appreciated.

jdMorgan

2:40 pm on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See Apache core AllowOverride and Options directives -- You must enable mod_rewrite before you can use it.

If you want to enable it in httpd.conf, the use Options FollowSymLinks FileInfo or Options SymLinksIfOwnerMatch FileInfo.

If you wish to enable mod_rewrite at the .htaccess level (i.e. only in certain (sub)directories within each vHost and not for all (sub)directories of each vHost), then you must set AllowOverride Options (at a minimum) in httpd.conf, and place one of Options +FollowSymLinks or Options +SymLinksIfOwnerMatch in the .htaccess file(s) to enable mod_rewrite.

In this latter case, it is usual to set Options FileInfo (and any others) in httpd.conf, and then set Options +FollowSymLinks in .htaccess along with +/-Indexes, +/-MultiViews, etc. as desired. Take a look at the +/- add/subtract option syntax versus fixed Option declarations -- You'll likely want to establish fixed baseline Options in httpd.conf, and then use the add/subtract syntax at the .htaccess level. For performance and enhanced security, don't enable any Option unless you're sure you need it.

Jim

wellbornSun

10:59 pm on Aug 15, 2007 (gmt 0)

10+ Year Member



Thanks for the response,and all is working well; again, so far:). Now to install WordPress and get to work. Thanks.