After some research I find this way to handle seo and social media with single page applications,
Since I use Yii framework for the back-end, in the main layout file I got the parameters of the query string, So if the url contains "_escaped_fragment_", I take this variable and its value and got the result direct without including the sammyJS routers file.
so in the top of the layout file:
<?php
if(isset($_GET['_escaped_fragment_'])){
Return the data you want using PHP only don't relay on js,
from here you need to provide a full html page with all data.
}else{
include your sammy js routers file.. normal case
}
?>
and also you don't need any redirection from the htaccess file.
Thanks,