Wamp setting a custom domain name to access the PHP website

Source: Internet
Author: User
Tags php website

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
    1. Add a configuration item to your alias's configuration: Customizing a virtual host to point to a domain name
    2. Modify the native Hosts file to point your domain to 127.0.0.1
    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.