markdown 在XAMPP中配置别名

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 在XAMPP中配置别名相关的知识,希望对你有一定的参考价值。

## Preparing to Create XAMPP Alias Directories
The first thing you’ll want to do is add an alias directory to your XAMPP install. If you’re running Windows, create the following folder.

  `C:\xampp\apache\conf\alias`

Next, you’ll need to change your Apache configuration file. You can find it under `C:\xampp\apache\conf\httpd`.conf. To make changes, you’ll need to edit it as an administrator. If you’re running Windows Vista or above, your best bet is to open Notepad as an administrator and then open httpd.conf. To open Notepad (or any other application) as an administrator, right-click on it and select “Run as administrator”. You can also launch Notepad as an administrator from the start menu with `Ctrl+Shift+Enter` while Notepad is selected.

Once you’ve opened httpd.conf, add the following to the end and save it.

  `Include "conf/alias/*.conf"`

Now Apache will look in the alias folder for more configuration files. This way you can add an alias by simply adding a new configuration file to the conf/alias/ folder.

## Creating XAMPP Alias Directories
Let’s add some XAMPP alias directories. Suppose you want to add an alias called “dev”. First, download this alias template file and place it in the alias folder. Rename it to “dev.conf” (or whatever you want to call your alias). You’ll need to edit the template and replace {DIRECTORY} (it’s at the beginning of the file and at the end) with the folder path, and replace {ALIAS} with the name of your alias. In our example, it looks something like this:

```xml
<Directory "c:\users\foo\programming\dev">
  #
  # Possible values for the Options directive are "None", "All",
  # or any combination of:
  #   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
  #
  # Note that "MultiViews" must be named *explicitly* --- "Options All"
  # doesn't give it to you.
  #
  # The Options directive is both complicated and important.  Please see
  # http://httpd.apache.org/docs/2.2/mod/core.html#options
  # for more information.
  #
  Options Indexes FollowSymLinks Includes ExecCGI

  #
  # AllowOverride controls what directives may be placed in .htaccess files.
  # It can be "All", "None", or any combination of the keywords:
  #   Options FileInfo AuthConfig Limit
  #
  AllowOverride All

  #
  # Controls who can get stuff from this server.
  #
  Require all granted

</Directory>

Alias /dev "c:\users\foo\programming\dev"
```

Restart Apache (you can do so from the XAMPP control panel) and check out http://localhost/dev. You can repeat this process with other aliases to add more XAMPP alias directories.

以上是关于markdown 在XAMPP中配置别名的主要内容,如果未能解决你的问题,请参考以下文章

XAMPP - 别名 127.0.0.1

在 Laravel 5.6 项目中使用 xampp 的虚拟主机中的别名

本地主机别名不适用于 XAMPP

如何在 xampp 中设置具有相同父服务器别名或名称的虚拟主机

markdown XAMPP - 用MySQL替换MariaDB

markdown XAMPP - 用MySQL替换MariaDB