yii 1.1.*僞靜態配置

apache:

<IfModule mod_rewrite.c>   
  
  
Options +FollowSymLinks  
IndexIgnore */*  
RewriteEngine on  
  
# if a directory or a file exists, use it directly  
RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
  
# otherwise forward it to index.php  
RewriteRule . index.php  
  
</IfModule>


nginx:

location / {
            try_files $uri $uri/ /index.php?$args;
        }
        location ~ [^/]\.php(/|$)
        {
            # comment try_files $uri =404; to enable pathinfo
            try_files $uri =404;
            #fastcgi_pass  unix:/tmp/php-cgi.sock;
            fastcgi_pass  192.168.41.249:9000;
            fastcgi_index index.php;
            include fastcgi.conf;
            #include pathinfo.conf;
        }

        location ~ /(\.svn|\.git|\.ht|\.DS) {
            deny all;
            internal;
        }
        location ~ /(protected|framework|nbproject|themes/\w+/views|index-test\.php) {
            deny all;
            # for production
            internal;
            log_not_found off;
            access_log off;
        }
        location ~* \.(js|css|png|jpg|jpeg|gif|ico|bmp|swf)$ {
             expires 30d;
             log_not_found off;
        }

        location ~ .*\.(js|css)?$
        {
            expires      12h;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章