Benutzer-Werkzeuge

Webseiten-Werkzeuge


en:sysadmin:tools:piwigo-mod_rewrite

Piwigo mod_rewrite for Apache

Piwigo is a nice photo galerie webservice. To get nice URLs without ".php" and "?", you'll need some settings in the php config file of piwigo and some mod_rewrite.

Example apache root directory: /var/www/piwigo

Piwigo Config (tested with 2.9.4)

locale Piwigo config: /var/www/piwigo/local/config/config.inc.php

<?php
// local/config/config.inc.php
$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false; 

?>

TIP: check the default config file for further ideas: include/config_default.inc.php

Apache (tested with: 2.4.29)

in the vhost config:

  DocumentRoot /var/www/piwigo/
  <Directory /var/www/piwigo/>
    Options -Multiviews +Indexes +FollowSymLinks

    ## rewrite with mod_rewrite:
    ## index -> index.php
    ## picture -> picture.php
    ## i -> i.php
    
    RewriteEngine on
    RewriteRule ^index/(.*)     index.php/$1   [QSA,L]
    RewriteRule ^picture/(.*)   picture.php/$1 [QSA,L]
    RewriteRule ^i/(.*)         i.php/$1       [QSA,L]
    
    # for debugging of the rewrite-rules:
    #LogLevel alert rewrite:trace6

  </Directory>
en/sysadmin/tools/piwigo-mod_rewrite.txt · Zuletzt geändert: 2019-10-03 16:30 von hella

Seiten-Werkzeuge

Mastodon Twitter