I have a Drupal site, and I have configured Apache to let me write 'localhost/SITENAME' in the browser when the site is in /Users/USERNAME/Sites

My site folder is called practice.

I also configured a virtualhost that kind-of works, called practice.loc

The problem is, when I click on the home link on the Drupal site, it goes to practice.loc/practice instead of just practice.loc

How can I make it just go to practice.loc when I click on the home link?

PS: I have looked at this question, it did not help me.

This is how my httpd-vhosts.conf file looks:

# 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.

# 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>
DocumentRoot "/Users/victor/Sites/wk/web"
ServerName wk.loc
<VirtualHost *:80>
DocumentRoot "/Users/victor/Sites/practice"
ServerName practice.loc

And my hosts file:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost broadcasthost
::1              localhost       wk.loc       practice.loc

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.