Skip to content

Instantly share code, notes, and snippets.

@ralphcrisostomo
Last active November 20, 2022 08:12
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ralphcrisostomo/4974674 to your computer and use it in GitHub Desktop.
Save ralphcrisostomo/4974674 to your computer and use it in GitHub Desktop.
Create an alias directory in XAMPP
# Create an alias directory in XAMPP
# Ref: http://www.mauriciomunera.com/?p=127
# Ref: https://gist.github.com/ralphcrisostomo/4974674/
# Open the file /Applications/xampp/etc/httpd.conf in a text editor.
# Add these lines to the end of the files. (change the name of the alias for the web application that suits better for you)
<IfModule alias_module>
#
# Redirect: Allows you to tell clients about documents that used to
# exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
#
# Alias: Maps web paths into filesystem paths and is used to
# access content that does not live under the DocumentRoot.
# Example:
# Alias /webpath /full/filesystem/path
#
# If you include a trailing / on /webpath then the server will
# require it to be present in the URL. You will also likely
# need to provide a <Directory> section to allow access to
# the filesystem path.
# http://localhost/projects -> /Users/ralfcrisostomo/Projects
Alias /projects /Users/ralfcrisostomo/Projects\
<Directory "/Users/ralfcrisostomo/Projects">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
#
# ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
# client. The same rules about trailing "/" apply to ScriptAlias
# directives as to Alias.
#
ScriptAlias /cgi-bin/ "/Applications/XAMPP/xamppfiles/cgi-bin/"
</IfModule>
# Search for "IfModule !mpm_netware_module"
# Change the user name to your Mac username (the one you user to login in you computer, so the code should look this this:
<IfModule !mpm_netware_module>
#
# If you wish httpd to run as a different user or group, you must run
# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
# running httpd, as with most system services.
#
User your_mac_username
Group admin
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment