-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapache.conf
More file actions
33 lines (25 loc) · 975 Bytes
/
apache.conf
File metadata and controls
33 lines (25 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
DocumentRoot /var/www/html/
<Directory /var/www/html/>
AllowOverride All
ErrorDocument 404 /404
Require all granted
# Abilita rewrite engine
RewriteEngine On
# Redirecta tutte le richieste a index.php
RewriteRule ^index\\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# # Gestione della homepage
# RewriteRule ^$ index.php [L]
# # Rewrite /profilo/username to /profilo?user=username
# RewriteRule ^profilo/([^/]+)/?$ profilo.php?user=$1 [L,QSA]
# # Se la richiesta non è per una directory esistente
# RewriteCond %{REQUEST_FILENAME} !-d
# # Se esiste un file .php con lo stesso nome
# RewriteCond %{REQUEST_FILENAME}\.php -f
# # Escludi profilo.php dal rewrite generico
# RewriteCond %{REQUEST_URI} !^/profilo\.php
# # Rewrite della richiesta al file .php
# RewriteRule ^(.*)$ $1.php [L]
</Directory>