第1个问题
var $compile_dir     =  "templates_c";    //linux下这里面应该是怎么样的啊
$_SERVER['DOCUMENT_ROOT']为/home1/vhost/vh428200/www//var $compile_dir     =  'd:\web\components\libs\Smarty\templates_c';   // xp 下是这么的linux 不熟悉啊!!
第2个问题
linux 伪静态 跟xp下的apache 有啥不一样么??.htaccess
/------------------------
RewriteEngine On
RewriteBase /
RewriteRule ^type/(.*)/order/([0-9]+)$ index_c.php?type=$1&order=$2
RewriteRule ^type/(.*)/order/([0-9]+)/page/([0-9]+)$ index_c.php?type=$1&order=$2&page=$3RewriteRule ^user/([0-9]+)$ index_c.php?uid=$1RewriteRule ^user/([0-9]+)/type/(.*)/page/([0-9]+)$ index_c.php?uid=$1&type=$2&page=$3
RewriteRule ^user/([0-9]+)/type/(.*)$ index_c.php?uid=$1&type=$2RewriteRule ^user/([0-9]+)/myclick/(.*)/page/([0-9]+)$ index_c.php?uid=$1&myclick=$2&page=$3
RewriteRule ^user/([0-9]+)/myclick/(.*)$ index_c.php?uid=$1&myclick=$2
RewriteRule ^user/([0-9]+)/page/([0-9]+)$ index_c.php?uid=$1&page=$2RewriteRule ^re1d-([0-9]+)$ /top.php?itemid=$1
RewriteRule ^s=(.*)$ /search.php?s=$1RewriteRule ^type/(.*)/page/([0-9]+)$ index_c.php?type=$1&page=$2
RewriteRule ^type/(.*)$ index_c.php?type=$1 [L]
-----------
for linux 是怎么样的啊?

解决方案 »

  1.   

    第一个问题,稍微扯远一点。在Linux下,Smarty的四个目录最好不要放在你的站点的根目录下,而是独立出去。一般而言,我会这样设置:网站根目录:/var/www/site01Smarty目录:/var/smarty然后给Smarty下的cache, templates_c目录以777的权限。第二个问题,只要你用的是apache,那么重写规则就没有区别。
      

  2.   


    第 1 个: linux  路径 一般都 是  /xx/xx/template_c第 2 个: 是一样的
      

  3.   

    1.template_c的路径最好放在/home1/vhost/vh428200下,例如:/home1/vhost/vh428200/template_c,权限777。不要放在/home1/vhost/vh428200/www
    2.都一样没有区别
      

  4.   


    这么做有安全隐患,因为用户可以直接访问template_c了。Smarty的官方教程也提到过,Smarty的目录不要和站点目录混在一起。
      

  5.   

    1 :首先,linux 是区分大小写的,和有严格的目录权限,var $compile_dir    =  "templates_c";  这个是相对smarty 类文件的目录,可以设置绝对路径 /home/什么地址什么的
    2; 一样