Announcement

#1 2016-09-15 02:19:02

Marcell
Guest

How to modify piwigo seo urls?

The piwigo seo urls is not very clean and include some unwanted words. I want to modify and delete unwanted words in the urls.

---

*The first question is:

How to modify sequence of image and category name in the urls?

from

www.site.com/picture/1-picture-name/cat … gory-name/

to

www.site.com/category/1-category-name/p … ture-name/

---

*The second question is:

How to remove "index" unwanted word from the url? Only visible if click on any category. Not visible on the front or any image page...

from

www.site.com/index/category/1-category-name/

to

www.site.com/category/1-category-name/

---

*The third question is:

How to remove id from category?

from

www.site.com/index/category/1-category-name/

to

www.site.com/index/category/category-name/

It would also be a big help if have someone could tell which files should to edit?

 

#2 2016-09-15 06:15:27

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
6745

Re: How to modify piwigo seo urls?

Hi :-)

you can add in local config

// +-----------------------------------------------------------------------+
// |                                 urls                                  |
// +-----------------------------------------------------------------------+

// gallery_url : you can set a specific URL for the home page of your
// gallery. This is for very specific use and you don't need to change this
// setting when move your gallery to a new directory or a new domain name.
$conf['gallery_url'] = null;

// question_mark_in_urls : the generated urls contain a ? sign. This can be
// changed to false only if the server translates PATH_INFO variable
// (depends on the server AcceptPathInfo directive configuration)
$conf['question_mark_in_urls'] = true;

// 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;

// category_url_style : one of 'id' (default) or 'id-name'. 'id-name'
// means that an simplified ascii represntation of the category name will
// appear in the url
$conf['category_url_style'] = 'id';

// picture_url_style : one of 'id' (default), 'id-file' or 'file'. 'id-file'
// or 'file' mean that the file name (without extension will appear in the
// url). Note that one aditionnal sql query will occur if 'file' is choosen.
// Note that you might experience navigation issues if you choose 'file'
// and your file names are not unique
$conf['picture_url_style'] = 'id';

// tag_url_style : one of 'id-tag' (default), 'id' or 'tag'.
// Note that if you choose 'tag' and the url (ascii) representation of your
// tags is not unique, all tags with the same url representation will be shown
$conf['tag_url_style'] = 'id-tag';


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#3 2016-09-15 07:46:32

eliz82
Member
Romania
2016-04-27
246

Re: How to modify piwigo seo urls?

Marcell wrote:

How to modify sequence of image and category name in the urls?

You can't do it without big changes to the core files.

Marcell wrote:

How to remove "index" unwanted word from the url? Only visible if click on any category. Not visible on the front or any image page...

Can't do it, at least not from the config. You can only remove php extension from index.php see ddtddt response. That option only works on Apache servers (not Nginx or Lighttpd).
Maybe with some htaccess url rewrite magic you can remove index.php entirely , ask here http://stackoverflow.com/questions/tagged/url-rewriting

Marcell wrote:

How to remove id from category?

You must enter your Admin options and manually set permalinks for all categories , then activate "name only" in config, see ddtddt response.
The good part is that when you set permalinks you can use this kind on notation "album/subalbum" as a permalink name.

P.S.   Coming from Gallery2 I understand why you don't like Piwigo urls. In Gallery2 when I activate url rewrite I have this kind of urls:
.site.com/galleryname/album-name(or user name)/subalbum-name/picture-name.html
That can generate a url of this type:
.site.com/albums/eliz82/insects/2014/ladybug01.html
Very humanly readable compared with Piwigo. Zenphoto urls are similar to Gallery2.

Last edited by eliz82 (2016-09-15 08:24:34)

Offline

 

Board footer

Powered by FluxBB

github twitter facebook google+ newsletter Donate Piwigo.org © 2002-2019 · Contact