Skip to content

Textcube的Nginx Rewrite

[code]server {
    root / #(放置textcube的目錄);
    include /etc/nginx/fastcgi_php;
location /  {
if (!-f $request_filename) {
  rewrite ^(thumbnail)/([0-9]+/.+)$ cache/$1/$2;
}  
if ($request_filename ~* ^(cache)+/+(.+[^/])\.(cache|xml|txt|log)$) {
  return 403;
}  
if (-d $request_filename) {
  rewrite ^(.+[^/])$ $1/;
}  
rewrite ^(.*)$ /rewrite.php last;
}}[/code]

官方版本為需要跟目錄(例如domain.com/blog),
此版本可以使用domain.com主目錄訪問,
不需要跟目錄下去運作,Demo就是本網站。

Published inTool

One Comment

Leave a Reply to Hina Cancel reply

Your email address will not be published. Required fields are marked *