#1 2008-06-08 20:35:05

carminejg3
Member
2008-05-23
35

mod-rewrite

Where is the file that controls the way phpwebgallery writes out the files?

I'm trying to see if I could get the urls to look like...

/photo/285/487/White_horse.html

instead of

/pictures/picture.php?/94/category/4

Offline

 

#2 2008-06-08 22:28:04

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

Re: mod-rewrite

Url rewriting has several standard solutions.

$conf['picture_url_style']

Install LocalFiles Editor
in ./plugins/
> Admin > Plugins > Adminintration > Install + Activate

LocalFiles Editor will help you to code the $conf['picture_url_style'].

8-)

Code:

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

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

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

Offline

 

#3 2008-06-09 03:32:36

carminejg3
Member
2008-05-23
35

Re: mod-rewrite

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

what would i need to do to set it up so i could take out the php.php file?

do you have a seprate .htaccess file for the web gallery

Last edited by carminejg3 (2008-06-09 18:35:37)

Offline

 

#4 2008-06-10 08:48:05

linuxlefty
Member
China
2008-04-13
65

Re: mod-rewrite

You'll need to set the php_extension_in_urls value to "true". Then, you'll need to create a .htaccess file at the gallery root containing the line "Options +MultiViews"

Offline

 

#5 2008-06-12 21:54:46

carminejg3
Member
2008-05-23
35

Re: mod-rewrite

Hi Guys,

With the mod-rewrites.  What about the option to have the rewritten url end in html or php.

http://site.com/pictures/picture/718/ca … 5-infiniti

to
http://site.com/pictures/picture/718/ca … initi.html

is this possible or would it casue more problems

Offline

 

#6 2008-06-13 00:48:18

linuxlefty
Member
China
2008-04-13
65

Re: mod-rewrite

It would require a change in the way that PWG creates links and then a change in the .htaccess file. It shouldn't be too big of a change. I'll take a look this weekend.

Offline

 

#7 2008-06-19 08:10:46

linuxlefty
Member
China
2008-04-13
65

Re: mod-rewrite

Well it is possible, and it wouldn't be a _huge_ amount of work

Basically the make_section_in_url and make_index_url functions in functions_url.inc.php would have to change. Than an .htaccess file would need to be created.

However, I'm not sure if that is worth the effort just to add the .php extension.

Offline

 

Board footer

Powered by FluxBB