Announcement

#1 2021-09-24 10:10:12

stevebni
Member
2021-05-03
28

Tidy / Clean / Friendly (call them what you will) URL's. Nearly there.

Hi, first off I have to say I'm surprised this isn't already baked into Pwigo. In 2021 it's a really odd thing to overlook.

But anyway... Tidy URL's.

I've read piles of post on this forum but nothing much worked for me without breaking other things, so I dived in and had a play.

I've used the permalink plugin to add permalinks for albums.

I used Localfile plugin to add $conf['picture_url_style'] = 'id-file'; to the core code.

And I've added the following to the htaccess file...

RewriteEngine On
RewriteBase /

# Removes index.php
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.baskerville.me/$1 [R=301,L]
RewriteRule ^(.*)index$ http://www.baskerville.me/$1 [R=301,L]

# Removes picture.php
RewriteCond %{THE_REQUEST} ^.*/picture.php
RewriteRule ^(.*)picture.php$ http://www.baskerville.me/$1 [R=301,L]
RewriteRule ^(.*)picture$ http://www.baskerville.me/$1 [R=301,L]

It's almost there, but I can't get rid of the question marks in the URL...

https://www.baskerville.me/

Anyone any idea?

To the Piwigo guys: C'mon, this is basic stuff nowadays. Can you bake Tidy URL's right into Piwigo in a future update?

Offline

 

#2 2021-09-24 10:19:02

stevebni
Member
2021-05-03
28

Re: Tidy / Clean / Friendly (call them what you will) URL's. Nearly there.

Edit: Scrap that, it's not working. It's killing the final link to the actual photo in a gallery.

I give up. I'll just hope version 12 has tidy URL's baked in.

Offline

 

#3 2021-09-24 18:49:53

Katryne
Member
2016-12-03
369

Re: Tidy / Clean / Friendly (call them what you will) URL's. Nearly there.

You may try what I did :
     
1 - In root htaccess (create it if it does not exist) I can't remember today why this, but I note it down with Nr 2.

Code:

AcceptPathInfo On
Options +MultiViews

2 - With the plugin Local Files Editor, tab Local Config :

Code:

<?php
$conf['question_mark_in_urls'] = false;
$conf['php_extension_in_urls'] = false;
$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'file';
?>

http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#4 2021-09-24 19:04:53

stevebni
Member
2021-05-03
28

Re: Tidy / Clean / Friendly (call them what you will) URL's. Nearly there.

Oh that works, very nice. Thanks so much.

Offline

 

#5 2021-09-24 20:52:38

erAck
Only trying to help
2015-09-06
2029

Re: Tidy / Clean / Friendly (call them what you will) URL's. Nearly there.

You might also want to add

Code:

$conf['tag_url_style'] = 'tag';

Read in include/config_default.inc.php about the implications it has.


Running Piwigo at https://erack.net/gallery/

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact