[installation & upgrade] can't customize urls if PATH_INFO is undefined #276

Open
opened 2026-10-04 23:50:22 +02:00 by adam · 1 comment
Owner

Reported by Tequila on 2 Oct 2014 18:32

Version: 2.7.0

If question_mark_in_URLs is false, as stated in your SEO URLs directions, a white page containing a header and a left menu only with no template design and no css is displayed. Neither error messages nor content images are displayed. I tried with different themes and different browsers and the issue remains.

Steps to reproduce: 1. Install Piwigo 2.7.0 on a 1and1 shared hosting server.
2. Activate Friendly SEO URL through 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';
?>

  1. Activate/configure directives through htaccess:

htaccess piwigo

AcceptPathInfo On
Options +MultiViews

  1. Visit Piwigo's gallery home page.

Additional information: Piwigo 2.7 is now working fine on my 1and1 shared hosting server after applying the following two patches:

  1. PATH_INFO is undefined on my shared hosting server and was replaced by ORIG_PATH_INFO in section_init.inc.php and functions_cookie.inc.php.

  2. At the home page ORIG_PATH_INFO took the value of "/photos/index.php", so in this case $page['root_path'] should take the value of PHPWG_ROOT_PATH in section_init.inc.php.

Piwigo Bugtracker #3151

**Reported by Tequila on 2 Oct 2014 18:32** **Version:** 2.7.0 If question_mark_in_URLs is false, as stated in your SEO URLs directions, a white page containing a header and a left menu only with no template design and no css is displayed. Neither error messages nor content images are displayed. I tried with different themes and different browsers and the issue remains. **Steps to reproduce:** 1. Install Piwigo 2.7.0 on a 1and1 shared hosting server. 2. Activate Friendly SEO URL through local/config/config.inc.php: &lt;?php $conf[&#039;question_mark_in_urls&#039;] = false; $conf[&#039;php_extension_in_urls&#039;] = false; $conf[&#039;category_url_style&#039;] = &#039;id-name&#039;; $conf[&#039;picture_url_style&#039;] = &#039;file&#039;; ?&gt; 1. Activate/configure directives through htaccess: # htaccess piwigo AcceptPathInfo On Options +MultiViews 1. Visit Piwigo&#039;s gallery home page. **Additional information:** Piwigo 2.7 is now working fine on my 1and1 shared hosting server after applying the following two patches: 1) PATH_INFO is undefined on my shared hosting server and was replaced by ORIG_PATH_INFO in section_init.inc.php and functions_cookie.inc.php. 2) At the home page ORIG_PATH_INFO took the value of &quot;/photos/index.php&quot;, so in this case $page[&#039;root_path&#039;] should take the value of PHPWG_ROOT_PATH in section_init.inc.php. [Piwigo Bugtracker #3151](http://piwigo.org/bugs/view.php?id=3151) <!-- github-sync-id:97226892 -->
Author
Owner

Hello,

This is Tequila from Mexico.

I have to apply the same patch every time I upgrade Piwigo to the latest version which is a tedious and risky process. So, this time when I upgraded my gallery to v2.9..5 I researched for a more appropriate method and found the following patch recommendation from mevdschee:

if (isset($_SERVER['ORIG_PATH_INFO'])) $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];

I applied this patch to the following scripts and Piwigo is now working fine again on my 1and1 (IONOS) shared hosting server:

i.php
/include/common.inc.php
/include/ functions_cookie.inc.php
/include/section_init.inc.php

Regarding the home page issue, I also learnt that I should include "/index.php/" at the end of the home page URL for $_SERVER['ORIG_PATH_INFO'] to get the proper value. So, gallery is linked as "/piwigo/index.php/" (using a trailing slash in my URL) on the website menu and I included the following script line in local/config/config.inc.php.

$conf['gallery_url'] = '/piwigo/index.php/';

This way, server delivers $_SERVER['ORIG_PATH_INFO'] properly on the home page and no additional patch is needed.

Thanks for your great work, you have a fantastic web application.

Hello, This is Tequila from Mexico. I have to apply the same patch every time I upgrade Piwigo to the latest version which is a tedious and risky process. So, this time when I upgraded my gallery to v2.9..5 I researched for a more appropriate method and found the following patch recommendation from [mevdschee](https://github.com/mevdschee): `if (isset($_SERVER['ORIG_PATH_INFO'])) $_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];` I applied this patch to the following scripts and Piwigo is now working fine again on my 1and1 (IONOS) shared hosting server: i.php /include/common.inc.php /include/ functions_cookie.inc.php /include/section_init.inc.php Regarding the home page issue, I also learnt that I should include "/index.php/" at the end of the home page URL for $_SERVER['ORIG_PATH_INFO'] to get the proper value. So, gallery is linked as "/piwigo/index.php/" (using a trailing slash in my URL) on the website menu and I included the following script line in local/config/config.inc.php. `$conf['gallery_url'] = '/piwigo/index.php/';` This way, server delivers $_SERVER['ORIG_PATH_INFO'] properly on the home page and no additional patch is needed. Thanks for your great work, you have a fantastic web application. <!-- github-comment-id:515650070 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#276