linuxapachedrupalcentosclean-urls

Why don't my clean URL's work in Drupal, even though rewrite_module is present?


Hey guys. I'm asking this question here as a last resort, since I've been trying to solve the issue for almost two days now.

I'm trying to enable clean URL's on my Drupal web application. I have visited several public questions such as this one, but to no avail. My sincerest apologies if this is thus a repost.

Some (relevant) context:

I'm setting up a LAMP stack on the VM using the following:

yum -y install httpd

wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup

chmod +x mariadb_repo_setup

./mariadb_repo_setup

yum -y install mariadb-server

yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm

yum-config-manager --enable remi-php74

yum -y install php php-mysql

Running the application, everything goes fine, and the following output is produced:

Drupal warnings top part

Drupal warnings bottom part

I'm aware of the other two warnings, but those are a worry for another day. When I continue despite the warnings, Apache loads index.php just fine:

Screenshot of index.php

However, the moment I click any button, this happens:

Screenshot of yet another problem

I suspect this is a consequence of the clean URL's not being enabled. However, as far as I know, all necessary modules have been installed.

What I have tried so far:

Help would be greatly appreciated. Many thanks in advance. If you require any more information, I will respond as soon as possible.


Solution

  • Hey guys. The issue has been solved.

    Somehow, it suddenly works. I am now able to navigate the website without a Not Found error popping up.

    I retried a method that didn't work before, but now it does. There was no change in any other variables. I edited /etc/httpd/conf/httpd.conf. Besides already having changed DocumentRoot to /var/www/drupal, I also added another piece of configuration right under that:

    <Directory "/var/www/drupal">
      RewriteEngine on
      RewriteBase /
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !=/favicon.ico
      RewriteRule ^ index.php [L]
    </Directory>
    

    I obtained this information from here.

    The CLEAN URLS warning is still present though:

    Drupal warnings top part

    But there seems to be no problem when continuing despite the warnings. In fact, in the application itself, navigating to the errors/warnings section, the CLEAN URLS warning isn't even there!