User Tools

Site Tools


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/

// local/config/
$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false; 


TIP: check the default config file for further ideas: include/

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

en/sysadmin/tools/piwigo-mod_rewrite.txt · Last modified: 2019-10-03 16:30 by hella

Page Tools

Mastodon Twitter