How to allow clean urls for drupal in a linux machine with apache

In order to allow clear URLs for drupal within a linux machine with apache, follow this process :

 

Required data

  • apache configuration file = This is the apache file that must be modified in order to allow clean URLs (it could be a configuration file for a virtual host )

 

Sample data

  • apache configuration file = httpd.conf

 

Process

 

1. Modify the apache configuration file

[abernal@sandbox conf]$ sudo vim /etc/httpd/conf/httpd.conf 

 

2. Edit the configuration that contains your drupal file system, for this case, change AllowOverride None to AllowOverride All

# Further relax access to the default document root:
<Directory "/var/www/html">
    #
    # 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.4/mod/core.html#options
    # for more information.
    #
    Options Indexes FollowSymLinks

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