Hello/Hi/Greetings,
Since Piwigo design the way URL is setup:
photos.transitriderproductions.com/index.php?/category/niagara-falls-transit-shuttle
but when you click a image, it takes to:
photos.transitriderproductions.com/picture.php?/3611/category/niagara-falls-transit-shuttle
Now the index.php has the top bar with website name and dark background but the picture.php doesn't. How I can make sure all layout are on the same page?
Also, can I force Piwigo to have a better page link for SEO like this:
photos.transitriderproductions.com/niagara-falls-transit-shuttle/3611/
Is there a way?
I have tried everything, no luck.
Let me know
Thanks
Last edited by myVortexServers (2023-04-11 08:48:24)
Offline
Hi,
you can try the following.
Local files editor plugin, add the following under 'local configuration' tab below <?php
$conf['question_mark_in_urls'] = false;
$conf['category_url_style'] = 'id-name';
$conf['picture_url_style'] = 'id-file';
$conf['original_url_protection'] = 'images';
$conf['derivative_url_style'] = 2;
$conf['php_extension_in_urls'] = false;
$conf['tag_url_style'] = 'tag';
If you will get an error viewing your gallery after doing the changes above:
Add the following lines to the .htaccess file:
AcceptPathInfo On
Options -Indexes +MultiViews
<Files "*.php">
MultiviewsMatch Any
</Files>
This will give you picture urls like this:
https://www.yourdomain/picture/pictureI … tegoryName
Cheers
Ralf
Offline
Are you sure this happens only after making the changes in local files editor?
Or are there any changes made in the css ?
Never had a layout problem after applying the settings for clean url's.
Offline
I tried your changes and found out that the line
$conf['php_extension_in_urls'] = false;
causes layout problems:
On the top level page of each album the pictures are not displayed at all and nothing can be clicked to enter the album.
Removing the line above fixes this and the URLs for pictures have changed.
My system:
Piwigo 13.6.0 Prüfen, ob eine neue Version verfügbar ist.
Installiert auf 2 Januar 2023, vor 3 Monate 3 Wochen 3 Tage
Betriebssystem: FreeBSD
PHP: 8.1.14 (Info anzeigen) [2023-04-26 19:11:58]
MySQL: 8.0.31 [2023-04-26 19:11:58]
Grafikbibliothek: ImageMagick 6.9.12-72
Theme: Bootstrap Darkroom
Plugins:
gdThumb
Offline
Note that the description in include/config_default.inc.php reads
// php_extension_in_urls : if true, the urls generated for picture and // category will not contain the .php extension. This will work only if // .htaccess defines Options +MultiViews parameter or url rewriting rules // are active. $conf['php_extension_in_urls'] = true;
So apart from that the "if true, ..." is a typo and should read "if false, ..." (submitted PR https://github.com/Piwigo/Piwigo/pull/1906 fwiw..) you'll need
Options +MultiViews
in your Piwigo .htaccess file, otherwise the web server does not find a picture.php or category.php file when only picture or category is given. Caveat, do not have other files with the same basename in the directory, e.g. if there exist picture.old along with picture.php it may serve picture.old instead..
Offline
@Ralf
Just a quick "THANK YOU" for posting this. After months of frustration I know no longer see .php or ?
Many Thanks
Nigel.
Offline
Remember, these changes can be complex and may require a good understanding of web development concepts. If you’re not comfortable making these changes yourself, you might want to consider seeking help from a web developer familiar with Piwigo.
Offline