Dotclear

Ticket #1883 (closed enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

fastcgi path_info htaccess

Reported by: veris Owned by: team
Priority: highest Milestone:
Component: module:core Version: 2.6.1
Severity: critical Keywords:
Cc:

Description

my server

php 5.3.*, apache 2, mod_fcgid, nginx

for fastcgi htaccess (path_info method)

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?/$1
RewriteRule ^index.php$  index.php?/

for fastcgi important "?" in rule

BUT

$_SERVER['PATH_INFO']
and
$_SERVER['ORIG_PATH_INFO']

ARE EMPTY

add this code in /inc/config.php

if (!isset($_SERVER['REQUEST_URI'])) {
	$_SERVER['REQUEST_URI'] = '';
}
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];

and Dotclear works!

Change History

comment:1 Changed 10 years ago by veris

hmm...

everything works except search (((

Document not found

The document you are looking for does not exist.

comment:2 Changed 10 years ago by veris

and when add comment

http://test.com/post/gfdfg?pub=1#pr

Document not found

The document you are looking for does not exist.

Last edited 10 years ago by veris (previous) (diff)

comment:3 Changed 10 years ago by veris

problem with "?" in url...

Last edited 10 years ago by veris (previous) (diff)

comment:4 Changed 10 years ago by bruno

While your browser perceives the URL as path_info URLS, the rewrite rules you set makes PHP (and therefore dotclear) think that all is query_string. In fact, the rewrite rules transform the path_info into querystrings from a PHP point of view.

Then, you should configure your blog with 'QUERY_STRING' setting, but without any "?" in blog URL (on your blog configuration page in admin). You also may remove the extra code in your config.php, and it should work (I have a similar setup on my blog).

Your htaccess may then look like (I only removed the "/" from the 2 last lines) :

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?$1
RewriteRule ^index.php$  index.php?

comment:5 Changed 10 years ago by bruno

OR, if you want to remain with PATH_INFO, your .htaccess should look like :

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php/$1
RewriteRule ^$  index.php/

with no "?" for the last 2 lines.

comment:6 follow-up: ↓ 7 Changed 10 years ago by veris

you don't understand me

sorry, dificult to translate

my htaccess works fine

yours htaccess - error - No input file specified.

because in fastcgi htaccess rule must contain symbol "?"

for example

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) index.php?/$1
RewriteRule ^$  index.php?/

this works

ok

BUT

$_SERVER['PATH_INFO']
and
$_SERVER['ORIG_PATH_INFO']

ARE EMPTY

I do so

$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];

but this not work when get or post request for example in search on blog

comment:7 in reply to: ↑ 6 Changed 10 years ago by bruno

By doing :

$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'];

You are "faking" path-info, that explains why search does not work on your blog.

My suggestion : keep the htaccess you currently have, but remove the line $_SERVERPATH_INFO?=... from your config.php.

Then, go to the admin section of your blog, in "blog preferences". There, select "QUERY_STRING", but leave the "blog url" as it is, then submit it.

You may now have your blog functional, with the search features working.

NB: your may see your blog as "PATH_INFO", but in fact, seen from dotclear code, it is QUERY_STRING, because your rewrite rules convert the PATH_INFO data into QUERY_STRING.

comment:8 Changed 10 years ago by veris

I have understood! )))

  1. htaccess
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule (.*) index.php?$1
  1. blog url " http://site.com/"
  1. method QUERY_STRING
  1. Hurrah )))

comment:9 Changed 10 years ago by veris

bruno, I can not register on your forum...  http://forum.dotclear.org/

and I can not register on  http://dotclear.org/translate To start translating Dotclear, first subscribe to the "translators" mailing list.

i didn't get a letters

comment:10 Changed 10 years ago by bruno

  • Status changed from new to closed
  • Resolution set to fixed

comment:11 Changed 10 years ago by franck

  • Milestone A definir deleted
Note: See TracTickets for help on using tickets.

Sites map