Je sais qu'il y a un certain nombre de façons différentes de rediriger en utilisant apache, mais je voulais vérifier si c'est la bonne façon de le faire via un hôte virtuel ?
<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example/public
<Directory "/var/www/example/public">
Options +FollowSymlinks
# Prevent Direct Access to files
<FilesMatch "\.(tpl|ini|log)">
Order deny,allow
Deny from all
</FilesMatch>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
</Directory>
<Directory "/var/www/example/public/admin/view/javascript/ckeditor">
AddType application/x-javascript .js
AddType text/css .css
AddType text/xml .xml
</Directory>
ErrorLog /var/log/apache2/example-error.log
LogLevel warn
CustomLog /var/log/apache2/example-access.log combined
</VirtualHost>
# Redirect for all non existent subdomains
<VirtualHost *:80>
ServerAlias *.example.com
Redirect 301 / http://www.example.com
</VirtualHost>