Bonjour à tous, merci à ceux qui pourront m'aider.
Mon serveur AWS Apache2.4.29(Ubuntu) n'a pas l'air de lire les fichiers .htaccess files bien que j'ai activé le module rewrite (present in mods-enabled directory),
sudo a2enmod rewrite
Module rewrite already enabled
j'ai essayé cette solution :
https://superuser.com/questions/244245/how-do-i-get-apache-to-follow-symlinks
mais le résultat est une erreur 404
.htaccess dans var/www/html/testhtaccess :
Options +FollowSymlinks
Option Indexes
RewriteEngine on
RewriteRule ^nexistepas.html$ trouve.html [L]
/etc/apache2/apache2.conf (détail)
# Sets the default security model of the Apache2 HTTPD server. It does
# not allow access to the root filesystem outside of /usr/share and /var/www.
# The former is used by web applications packaged in Debian,
# the latter may be used for local directories served by the web server. If
# your system is serving content from a sub-directory in /srv you must allow
# access here, or in any related virtual host.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
#<Directory /srv/>
# Options Indexes FollowSymLinks
# AllowOverride None
# Require all granted
#</Directory>
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
#
# The following lines prevent .htaccess and .htpasswd files from being
# viewed by Web clients.
#
<FilesMatch "^\.ht">
Require all denied
</FilesMatch>
OOO-default.conf dans apache2/sites-enabled
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port t$
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
Quand je vais sur myserveradress/testhtaccess/nexistepas.html, j'ai une erreur 404. Je pense que c'est l'option FollowSymlinks qui n'est pas activé mais je ne suis pas très sûr de moi.
J'ai également essayé ça dans apache2.conf
<Directory /var/www/html/testhtaccess>
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
Et maintenant l'erreur est 500.
Merci si vous pouvez m'aider.