Announcement

#1 2011-06-09 18:09:26

paradigm
Member
2011-06-09
5

SEO URLs - need htaccess example

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:

Code:

<?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

 

#2 2011-06-09 18:27:31

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13180

Re: SEO URLs - need htaccess example

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


Latest blog post (November 9th 2018) Why Flickr could not remain free for ever

Offline

 

#3 2011-06-09 18:41:10

paradigm
Member
2011-06-09
5

Re: SEO URLs - need htaccess example

I think I must have Option -MultiViews in the servers apache configuration somewhere because once I did this below, everything worked!

In /.htaccess

Code:

AcceptPathInfo On
Options -Indexes +MultiViews

Thanks so much for your fast response and amazing software btw!
Cheers,
D

Offline

 

#4 2013-09-20 14:45:08

msakik
Translation Team
São Paulo, Brazil
2013-09-06
78

Re: SEO URLs - need htaccess example

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

 

#5 2013-09-20 14:50:17

mistic100
Former Piwigo Team
Lyon (FR)
2008-09-27
3271

Re: SEO URLs - need htaccess example

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

 

#6 2014-02-18 20:44:58

willyg1982
Member
2014-02-18
1

Re: SEO URLs - need htaccess example

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

 

#7 2014-07-29 15:02:14

moorezilla
Member
Massachusetts
2014-07-25
8

Re: SEO URLs - need htaccess example

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

 

#8 2015-03-05 17:54:13

INTEGRATIONIST
Member
2014-02-24
16

Re: SEO URLs - need htaccess example

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

 

Board footer

Powered by FluxBB

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