Mod Rewrite - Subdirectory verso dominio o sotto dominio
26 Oct
Posted by Sandro
Versione stampabileSend by emailPDF version
Spesso si ha la necessità di creare sottodomini del tipo nome.dominio.it ma in realtà il sito può essere raggiunto anche digitando www.dominio.it/dir1/dir2.
Per evitare che ci siano 2 vie per arrivare al sito si può usare il mod rewrite su server Apache.
Questa condizione, di semplice interpretazione non fa altro che redirigere tutte le chiamate destinate a dominio.it/dir1/dir2 verso http://nome.dominio.it
La regola deve essere inserita nel file .htaccess
Rewriteengine ON
RewriteCond %{HTTP_HOST} dominio.it
RewriteCond %{REQUEST_URI} ^/dir1/dir2/(.*)$
RewriteRule .* http://nome.dominio.it/%1 [R]
PHP e Open Source
Drupal
- InterWorks Drupal Blog: Auditing a Drupal Core Install
- DrupalCon Munich: Community sets sights on DrupalCon Europe
- Drupal Watchdog: Building a Mobile Version Of Your Website With Panels
- David Corbacho: Drupal with Twig templates
- Drupalpress, Drupal in the Health Sciences Library at UVA: Rule Scheduling and Emailing Views According to CCK date fields
Drupal planet
- InterWorks Drupal Blog: Auditing a Drupal Core Install
- DrupalCon Munich: Community sets sights on DrupalCon Europe
- Drupal Watchdog: Building a Mobile Version Of Your Website With Panels
- David Corbacho: Drupal with Twig templates
- Drupalpress, Drupal in the Health Sciences Library at UVA: Rule Scheduling and Emailing Views According to CCK date fields

