Wamp is a very good PHP development Kit under the window system, which I have developed and tested locally using this suite .in particular, the alias function is particularly good, can be developed at the same time n PHP Web site without affecting each other But alias has a problem, it actually treats the different alias as a different directory, so the address in the browser is like this http://localhost/think. One of the think is an alias. and this brings up a problem, if the path of the resource file (css,js, picture, etc.) in the page is this: "/js/jquery.min.js", then the local file is actually not the effect I want to get because the path to this JS file is "http://localhost/js/jquery.min.js" which causes me to be unable to load this file when I test locally ( There is no problem with the online environment) OKApache's powerful configuration can resolve this issue with custom configuration
- Add a configuration item to your alias's configuration: Customizing a virtual host to point to a domain name
- Modify the native Hosts file to point your domain to 127.0.0.1
- Configure Apache to
Set up a think.conf file in the Wamp\alias directory and enter the following:
#设置别名Alias/think "f:/temp/demo/php/think/" #设置虚拟主机 <virtualhost *:80> documentroot "f:/temp/demo/php/ think/" #网站目录 ServerName tp5.com #域名, need to modify the native Hosts file, tp5.com to 127.0.0.1</virtualhost># Access to phpMyAdmin from outside # Replace the lines## Require local## by## Require all Granted#<directory "F:/temp/de mo/php/think/"> Options Indexes followsymlinks multiviews allowoverride all <ifdefine APACHE24 > Require local </IfDefine> <ifdefine! Apache24> Order Deny,allow Deny from all to allow from localhost:: 1 127.0.0.1</ifdefine> Php_admin_value upload_max_filesize 128M php_admin_value post_max_size 128M php_admin_value max_execution _time php_admin_value max_input_time 360</directory>
Access via domain name via alias Access does not affect other alias references: Apache VirtualHost ExamplesThinkPHP5 Quick Start
From Wiznote
Wamp setting a custom domain name to access the PHP website