You are here: Mod_rewrite and file_get_contents « PHP Programming Language « IT news, forums, messages
Mod_rewrite and file_get_contents

Posted by Eduardo on 10/11/06 14:57

Hi people

I'm working with ajax in PHP 5 posting JSON thru raw_post_data.
The data get with file_get_contents function.

That's all works until config the .haccess file.

I make that to all articles names load Artigo.php. Example:
Artigos/Meu_primeiro_artigo
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule Artigos/.* Artigo.php [L]

But thet Google Web Toolkit loads files as relative,
then I add that rule before to redirect files from root.
Example:
/Artigos/40A05E9B46169250E9F876F954A53EE1.cache.html ->
/40A05E9B46169250E9F876F954A53EE1.cache.html

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*\.[a-z]{2,4}$ /%{PATH_INFO} [L]

And all info raw_post_data desapear!!
Somebody have an idea? I'm doing something wrong?
Thanks a lot



//PHP code
$data = file_get_contents('php://input'); // that values desapear
$json = new Services_JSON();
$json_ = $json->decode( $data );

//.htaccss code
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .*\.[a-z]{2,4}$ /%{PATH_INFO} [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule Artigos/.* Artigo.php [L]

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация