Hey guys,
I've tried setting up a website with version 2.2.2 and wish to use SEO URLs. My problem is that I'm not sure what to use for mod_rewrite (or even if it can be done) in Apache's htaccess or configuration files.
Currently I have this in local/config/config.inc.php:
<?php $conf['question_mark_in_urls'] = false; $conf['php_extension_in_urls'] = false; $conf['category_url_style'] = 'id-name'; $conf['picture_url_style'] = 'file'; ?>
It works great except for the "404 Page Not Found" errors
Does anyone have an htaccess file with configuration that will work with the above <?php * ?> config?
Or am I doing something wrong in my config.inc.php?
Cheers,
D
Offline
Hi paradigm,
// 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;
=> AcceptPathInfo On
// 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;
=> Options MultiViews
Offline
I think I must have Option -MultiViews in the servers apache configuration somewhere because once I did this below, everything worked!
In /.htaccess
AcceptPathInfo On Options -Indexes +MultiViews
Thanks so much for your fast response and amazing software btw!
Cheers,
D
Offline
Hi, my piwigo was not working and after some googling I dicovered that my htaccess need this line:
addType application/x-httpd-php .php
Just to register here for other visitors.
My server is ubuntu.
Offline
thanks for the info but next time don't bump a 2 years old topic,
and you are completely offtopic: this is about SEO urls, not random htaccess issues
Offline
I did't felt what msakik wrote was off topic. Adding that one extra line allow URL rewrite to work on my Linux server. I really glad he wrote this because I do my development and testing on a windows machine. Everything was working fine. When I migrated the code to Linux things was not working. If it was not for msakik for that one extra line of code, I would have to do the hard research msakik already did to find an solution.
Offline
I know this is an old post, but just wanted to second the fact that the note on
addType application/x-httpd-php .php
was the key to getting friendly urls working on my server as well.
I'm on ubuntu 14.04 with apache 2.4.x and I was getting 404's all over the place when enabling pretty urls, but adding the line above to an .htaccess file seems to have fixed things up.
Offline
Please, could anybody of the piwigo team add this info to the documentation - this is a very impornat piece of info and it would be great to improve the very poor documenation pages with important things like this!
This is an effort to make the piwigo documenation a valuable ressource, please help THANKS!
Offline