涉及到本地默认ip(localhost,127.0.0.1)设置关联地址时,使用XAMPP本地服务器时避免自动跳转设置的域名的一些处理方法

打开此文件,把内容修改如下


# Virtual Hosts
#
# Required modules: mod_log_config


# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.


#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ##ServerName or ##ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host.example.com
##DocumentRoot "D:/XAMPP/htdocs/dummy-host.example.com"
##ServerName dummy-host.example.com
##ServerAlias www.dummy-host.example.com
##ErrorLog "logs/dummy-host.example.com-error.log"
##CustomLog "logs/dummy-host.example.com-access.log" common
##</VirtualHost>


##<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
##DocumentRoot "D:/XAMPP/htdocs/dummy-host2.example.com"
##ServerName dummy-host2.example.com
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
##</VirtualHost>




<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/xampp/htdocs/trytry"
ServerName wx.trytry.la
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>


以下两个是必须的,这样才能,在使用SwitchHosts的基础上让默认的地址(127.0.0.1和localhost)关联的域名,在XAMPP本地服务器的基础上打开(默认打开也是这个默认地址)不跳转
SwitchHosts关联的域名,而是本地的文件,当然还有DocumentRoot这个具体的指向(用的时候去掉这些说明)


<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/xampp/htdocs"
ServerName localhost
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>


<VirtualHost *:80>
##ServerAdmin webmaster@dummy-host2.example.com
DocumentRoot "D:/xampp/htdocs"
ServerName 127.0.0.1
##ErrorLog "logs/dummy-host2.example.com-error.log"
##CustomLog "logs/dummy-host2.example.com-access.log" common
</VirtualHost>



用 SwitchHosts设置hotst, 用法示例的更多相关文章

  1. oracle中to_date详细用法示例(oracle日期格式转换)

    这篇文章主要介绍了oracle中to_date详细用法示例,包括期和字符转换函数用法.字符串和时间互转.求某天是星期几.两个日期间的天数.月份差等用法 TO_DATE格式(以时间:2007-11-02 ...

  2. 腾讯云上Selenium用法示例

    欢迎大家关注腾讯云技术社区-博客园官方主页,我们将持续在博客园为大家推荐技术精品文章哦~ 作者:崔庆才 前言 在上一节我们学习了PhantomJS 的基本用法,归根结底它是一个没有界面的浏览器,而且运 ...

  3. Go基础系列:nil channel用法示例

    Go channel系列: channel入门 为select设置超时时间 nil channel用法示例 双层channel用法示例 指定goroutine的执行顺序 当未为channel分配内存时 ...

  4. Go基础系列:双层channel用法示例

    Go channel系列: channel入门 为select设置超时时间 nil channel用法示例 双层channel用法示例 指定goroutine的执行顺序 双层通道的解释见Go的双层通道 ...

  5. Python排序算法之选择排序定义与用法示例

    Python排序算法之选择排序定义与用法示例 这篇文章主要介绍了Python排序算法之选择排序定义与用法,简单描述了选择排序的功能.原理,并结合实例形式分析了Python定义与使用选择排序的相关操作技 ...

  6. LoadPicture函数用法示例

    VB语言中LoadPicture函数用法示例: 本例使用 LoadPicture 函数将图片加载到窗体的 PictureBox 控件并从控件上清除掉该图片. 要试用此例,将 PictureBox 控件 ...

  7. linux日志中查找关键字、前几行、结尾几行,Linux的find用法示例

    linux在日志中查找关键字.前几行.结尾几行,Linux的find用法示例 1.linux在日志中查找关键字.前几行.结尾几行 1.1查看日志 前 n行: 1.2查看日志 尾 n行: 1.3根据 关 ...

  8. Linux find 用法示例

    Linux中find常见用法示例 ·find   path   -option   [   -print ]   [ -exec   -ok   command ]   {} \; find命令的参数 ...

  9. jQuery中$.fn的用法示例介绍

    $.fn是指jquery的命名空间,加上fn上的方法及属性,会对jquery实例每一个有效,下面有个不错的示例,喜欢的朋友可以参考下 如扩展$.fn.abc(),即$.fn.abc()是对jquery ...

随机推荐

  1. mac chrome 驱动配置

    将解压后的chromedriver移动到/usr/local/bin目录下

  2. dedecms首页调用随机文章全自动时时更新

    dedecms织梦系统是全站生成静态html的,这个对搜索引擎比较友好,但是有时我们要调用文章,让蜘蛛每次来访问都感觉像是有添加新内容一样,要如何做到呢? 可以添加以下dedecms随机文章调用的参数 ...

  3. 008-spring cloud gateway-路由谓词RoutePredicate、RoutePredicateFactory

    一.概述 Spring Cloud Gateway将路由作为Spring WebFlux HandlerMapping基础结构的一部分进行匹配. Spring Cloud Gateway包含许多内置的 ...

  4. rplidar跑cartographer

    一.Cartographer编译 cartographer依赖的大型第三方库很少,编译时基本没有依赖项问题,基本按照官方文档的步骤来,略作修改.使用的环境是Ubuntu16.04+ROS Kineti ...

  5. awesome go library 库,推荐使用的golang库

    https://github.com/avelino/awesome-go https://github.com/spf13/cobra                        # A Comm ...

  6. [py]戏说python面向对象细节

    面向对象圣经 认识面向对象 什么是面向对象? 有什么实在的好处? 被坑了这么多年,没弄清楚和面向过程有啥切身的区分 我以为这都是大学老师的错. 没把我们启蒙好. 这么多年深受其害. 总结起来三个字: ...

  7. (转)跨域的另一种解决方案——CORS(Cross-Origin Resource Sharing)跨域资源共享

    在我们日常的项目开发时使用AJAX,传统的Ajax请求只能获取在同一个域名下面的资源,但是HTML5打破了这个限制,允许Ajax发起跨域的请求.浏览器是可以发起跨域请求的,比如你可以外链一个外域的图片 ...

  8. jenkins 项目发布脚本

    构建shell #!/bin/bash ########################################################################## 编译部分 ...

  9. R语言学习笔记:基础知识

    1.数据分析金字塔 2.[文件]-[改变工作目录] 3.[程序包]-[设定CRAN镜像] [程序包]-[安装程序包] 4.向量 c() 例:x=c(2,5,8,3,5,9) 例:x=c(1:100) ...

  10. jmeter 线程组之间的参数传递(加密接口测试三)

    场景测试中,一次登录后做多个接口的操作,然后登录后的uid需要关联传递给其他接口发送请求的时候使用. 1.在登录接口响应信息中提取uid字段值 1>login请求 -->添加 --> ...