Php sets the apache configuration for accessing the browser on the mobile phone.
When we develop projects, we often develop web pages of browser versions. In this way, we often need to connect to the LAN with a mobile phone to facilitate testing. How can we configure Server files.
1. First shut down the windows Firewall on your computer, right-click my network, windows Firewall, and windows Firewall Status-> click Close.
2. The wampsever server has two statuses (online server status and offline server status). Click wampsever to switch to the online server status.
3. Configure the HOST file: My computer/C Disk/windows/system32/drivers/etc/HOSTS/
Configure the access path:
127.0.0.1 localhost127.0.0.1 app.weilan.com127.0.0.1 vip.weilan.com127.0.0.1 wap.weilan.com#0.0.0.1 mssplus.mcafee.com127.0.0.1 betterway.com127.0.0.1 yangzailu.com127.0.0.1 2016.com127.0.0.1 web.weilan.com
4. Configure apache:
Apache/apache2.4.9/conf/extra/httpd-vhosts.conf
Configuration: Put the file in the first place if you want to access it by mobile phone. The first file is loaded by default.
<VirtualHost *:80> ServerAdmin webmaster@dummy-host2.example.com ServerAdmin webmaster@dummy-host.example.com DocumentRoot "e:/www/WapSources/01 code" ServerName wap.weilan.com #ServerAlias www.dummy-host.example.com #ErrorLog "logs/dummy-host.example.com-error.log" #CustomLog "logs/dummy-host.example.com-access.log" common <Directory "e:/www/WapSources/01 code"> Options Indexes FollowSymLinks AllowOverride all Order allow,deny Allow from all </Directory> <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK) RewriteRule .* - [F] Rewriterule ^(.*)/(.*)/index.html$ $1/index.php?$2 Rewriterule ^(.*)/(.*)/index(\d+).html$ $1/index.php?$2&page=$3 Rewriterule ^(.*)/(.*)/a(\d+)\.html$ $1/index.php?$2/$3 Rewriterule ^(.*)/u/(\d+)/(.*)$ $1/index.php?u&$2&$3 Rewriterule ^(.*)/u/(\d+)/(.*)/$ $1/index.php?u&$2&$3 Rewriterule ^(.*)/u/(\d+)$ $1/index.php?u&$2 Rewriterule ^(.*)/u/(\d+)/$ $1/index.php?u&$2 Rewriterule ^(.*)/(.*)/index.html\?(.*) $1/index.php?$2&$3 Rewriterule ^(.*)/(.*)/index(\d+).html\?(.*) $1/index.php?$2&$3 Rewriterule ^(.*)/index.action(.*) $1/index.php$3 </IfModule> </VirtualHost>
5. Make sure that your mobile phone wireless network and computer wireless network are in a LAN.