Clean URLs not working I just have Drupal 7 and 8 installed in my localhost on Opensuse Leap. With Drupal 7 I cannot pass the clean urls test, however the site is completely functional. By clicking the links on the menu I can access localhost/drupal7/?q=admin/dashboard or localhost/drupal7/?q=admin/people (for example). 

In Drupal 8 I can access the front page localhost/drupal8 but when I click some link, for example "Log in", I'm redirected to localhost/htdocs/drupal8/user/login. And I get an Apache 404 error. I don't understand why the server redirects to another directory when both installations are using the same configuration file.

I already tried all drupal.org apache-related tutorials without success.

Does anybody know how to solve this issue?
I ran into this issue as well moving to opensuse leap from another distribution.  There was more than one problem.

Even if rewrite_module is listed in loadmodule.conf, this file is not not read without a change to httpd.conf.  You can check if the module is loaded with
apache2ctl -M

As is posted elsewhere Options and AllowOverride arguments need to be placed within the relevant Directory tags.

If there is a subdirectory of the webserver, there needs to be a RewriteBase argument given in the .htaccess file.


Try this to get things working:
In file /etc/apache2/default-server.conf
Within the &lt;Directory&gt; tags add or edit the Options and AllowOverride lines to
Options All
AllowOverride All

In file /etc/apache2/loadmodule.conf add
LoadModule rewrite_module    /usr/lib64/apache2-prefork/mod_rewrite.so

In file /etc/apache2/httpd.conf uncomment the IfDefine tags
#&lt;IfDefine !SYSCONFIG&gt;
  Include /etc/apache2/loadmodule.conf
#&lt;/IfDefine&gt;

In file /srv/www/htdocs/NAMEOFYOURSUBDIRECTORYHERE/.htaccess add a line
RewriteBase /NAMEOFYOURSUBDIRECTORYHERE

Check if the configuration file &quot;Syntax is OK.&quot;
It will probably complain that some modules have already been loaded, but that's alright.
 apache2ctl configtest

Restart Apache
systemctl stop apache2; sleep 5; systemctl start apache2