Announcement

#1 2009-02-26 17:37:14

Lykaon
Guest

Pretty URLs

I see in the features list that Piwigo can produce 'pretty URLs' with the names of the categories and pictures in them.  On my installation, however, I get URLs like:

picture.php?/82/category/5

So how do I turn on the 'pretty URL' stuff?  I see that I can manually make permalinks for each gallery, but that doesn't really help because the links on the site still use the ones like above.

Is this just a configuration option that I've missed somewhere?

Thanks!

 

#2 2009-02-26 18:31:28

Lykaon
Guest

Re: Pretty URLs

Okay.  So I figure out how to get urls like this:

picture.php?/181/category/cat1/subcat

But the image number is 181 and at the beginning of the URL.  Is there a way to include either the image name or the image filename in the url as well?

Thanks

 

#3 2009-02-26 21:46:31

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Pretty URLs

LocalFiles Editor Plugin

Local config (first tabsheet)

Try to play with:

Code:

// 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 false, 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';

Keep one LocalFiles Editor page open in your browser for a rollback if needed.

Last edited by VDigital (2009-02-26 21:48:40)


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#4 2009-02-27 01:52:58

Lykaon
Guest

Re: Pretty URLs

Thanks a lot!  That helped me make the URLs are a lot nicer.  I didn't even have a config_default.inc.php file yet.  Two more quick questions:

1) Is there a resource somewhere that describes everything I can put into that file?

2) Is there a way to change the order of the URL?  The image name is first, followed by the category and subcategory notations.  Is that because I'm using permalinks, or is that just the way it works?

Thanks for the help!  You've already helped tons.

 

#5 2009-02-27 07:58:57

VDigital
Former Piwigo Team
Paris (FR)
2005-05-04
17680

Re: Pretty URLs

1 - In the distributed config_default.inc.php (do NOT modify that one, config_local.inc.php is made for local exception overrides).

2 - No, by default. They are php hard coded. I will check if a plugin can change the order.


Piwigo.com: Start and run your own photo gallery. Signup and get 30 days to try for free, no commitment.
8-)

Offline

 

#6 2014-11-23 17:41:36

sport
Member
2014-03-16
93

Re: Pretty URLs

WARNING!!!!!!!!!!!!!!!!!!!!!!!!

i just did try this.
And as suggested "Keep one LocalFiles Editor page open in your browser for a rollback if needed."
And roll-back was needed because i just did get blank pages.

When i did the roll-back in local-files editor, it went al wrong.
It where only blank pages i did see. no matter what i did, or what web browser i used.

I have by ftp restored my config.inc.php to get it working all again.

its all okay now, but i think its good to say it here.
This is a old topic ;)

Offline

 

#7 2015-01-04 15:41:25

jc
Member
2015-01-04
22

Re: Pretty URLs

URL like www.host.tld/root/albumname/subalbumname/pictureid would be better. Is it possible to change it by module or by apache rewrite rules?

Offline

 

Board footer

Powered by FluxBB

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