#1 2025-01-11 03:14:06

SchuminWeb
Member
Maryland, USA
2024-02-20
48

Shortening default image URLs to exclude filename?

Greetings,

I am looking to shorten the default URL for my image pages on my Piwigo instance.  Currently, the site will default to URLs like this:

https://www.benschumin.com/picture/1860 … 257462816/

However, the following URL also works for the same thing:

https://www.benschumin.com/picture/18603/

I already use this shorter URL as the address of record when I'm linking to things both on and off of my Piwigo site, and so I would like this to be the URL that the site gives out automatically.  I already have modified my URL structure in my .htaccess file in order to tighten up the URLs.  Here's what I'm already doing there:

RewriteEngine On
RewriteCond %{HTTP_HOST}  !^www\.benschumin\.com$ [NC]
RewriteRule ^(.*) https://www.benschumin.com/$1 [L,R]

AcceptPathInfo On
Options -Indexes +MultiViews

<Files "*.php">
MultiviewsMatch Any
</Files>

I suspect that something in my .htaccess will make this happen, but this is out of my area of expertise, so I'm all thumbs when it comes to this.  Any idea what kind of lines I need to add to my htaccess to accomplish this?

Environment details: Piwigo 15.3.0 Check for upgrade
Installed on 12 July 2024, 5 months 4 weeks ago
Operating system: Linux
PHP: 8.2.26 (Show info) [2025-01-10 18:12:57]
MySQL: 8.0.36-0ubuntu0.22.04.1 [2025-01-10 18:12:57]
Graphics Library: ImageMagick ImageMagick 6.9.10-23
Cache size 25609.97 MB

Piwigo URL: https://www.benschumin.com/

Offline

 

#2 2025-01-11 11:45:07

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
14100

Re: Shortening default image URLs to exclude filename?

In your local configuration file local/config/config.inc.php (or use the LocalFiles Editor plugin), what do you have? I'm especially interested in the $conf['picture_url_style'] and $conf['category_url_style'] parameters.

Offline

 

#3 2025-01-12 03:06:41

SchuminWeb
Member
Maryland, USA
2024-02-20
48

Re: Shortening default image URLs to exclude filename?

plg wrote:

In your local configuration file local/config/config.inc.php (or use the LocalFiles Editor plugin), what do you have? I'm especially interested in the $conf['picture_url_style'] and $conf['category_url_style'] parameters.

Aha - that's where I needed to go for it.  I went in there and changed picture_url_style from id-file to just id, and that gave me exactly what I'm looking for.  Thank you very much for your assistance.

Last edited by SchuminWeb (2025-01-12 03:06:58)

Offline

 

Board footer

Powered by FluxBB