Good fellas,
My client requested a site in WordPress, for now I will call http://www.example.com, but he wanted the site displays it too as a Facebook Page. Because the server with SSL is for other domain http://www.serverssl.com, I put the wordpress site at a relative directory on serverssl, so I have this:
http://www.serverssl.com -> Document Root: /var/www/html/ (using ssl)
http://www.example.com -> Document Root: /var/www/html/example/site
For Facebook Page -> http://www.serverssl.com/example/site (using ssl)
Because WordPress is configured at relative path, at first time when I tried to get at Facebook Page it didn’t work. So I’ve added some lines to .htaccess at Document Root of WordPress:
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(.*)$ http://www.example.com/$1 [R,L]
So, if I tried to reach http://www.facebook/com/Client/app_00000000/ the iframe redirect to http://www.example.com so works fine.
Well, the client now wants other think: He wants a link to enter a Facebook Page that shows a specific page in wordpress. So I thought use app_data parameter, like this:
http://www.facebook.com/Client/app_00000000?app_data=specificpage
then at header.php of wordpress’ theme evalutes the $_REQUEST[‘signed_request’] parameter in order to search the app_data and then redirect to specificpage.
But the header.php nevers see the REQUEST send by Facebook,
I tried with the .htaccess:
RewriteCond %{QUERY_STRING} ^signed_request=(.*)$ [NC]
RewriteRule . http://www.example.com/%{QUERY_STRING} [R,L]
Still does not sent the signed_request.
Any idea how reach send signed_request through redirect?
PD: Sorry my bad english 🙁
If you load the page in a Facebook iframe it will always pass the signed_request on the first load.
I am not too great with mod-rewrite but I would suggest verifying the rewritecond on the signed request. Other values may have being transferred as well causing your condition to fail.