Apache - how to activate clean url (mod_rewrite)

I’m new in the world of nixos. I got my apache-server to run and have my vhost up and running. but my clean urls don’t work till now. According to my phpinfo the module mod_rewrite is loaded:

In my configuration.nix I wrote the following parts for the apache:

# Web server
  networking.extraHosts =
  '' mywebsite.de
  services.httpd.adminAddr = "kontakt@xxxxxxxx.de";
  services.httpd.enable = true;
  services.httpd.enablePHP = true;
  services.httpd.phpOptions =
      post_max_size = 200M
      max_execution_time = 6000
      max_input_time = 3000
      mbstring.http_input = pass
      mbstring.http_output = pass
      mbstring.internal_encoding = pass 
      memory_limit = 512M;
      allow_url_include = On;
   services.httpd.virtualHosts =
        serverAliases = ["mywebsite.de"];
        hostName = "mywebsite.de";
        documentRoot = "/home/Websites/mywebsite.de";
        #enableUserDir = true;
        extraConfig = 
        <Directory "/home/Websites/mywebsite.de/">
    	      DirectoryIndex index.php index.htm index.html
      	      Allow from *
              Options FollowSymLinks
              AllowOverride All

But no result!
Can you give me a hint?
I can also send you my whole configuration.nix or my /nix/store/xxxxxxxxxxx-httpd.conf if you like



Probably needs to be <Directory "/home/Websites/mywebsite.de/">?

Thanks a lot, that was certainly not right but the clean urls still don’t work yet :frowning: I already corrected that in my post.

Well, I replicated your services.httpd options (changing the paths and the email address), and .htaccess-based rewrite (I assume this is what you are after) does work for me.

Here is my .htaccess:

RewriteEngine On
RewriteRule ^getfile$ file.php [L]

When I request http://hostname/getfile, I get the result of file.php execution.

Thank you so much, I’ve found the problem. Somehow this was a bug in the Drupal CMS module for the url aliase. The module tells me that clean-urls are not supported and therefore the module cannot be activated. I’ve got the module activated via the database, and to my surprise it’s running now.