您當前的位置:首頁 > 動漫

魔眾系統偽靜態規則怎麼配

作者:由 魔眾 發表于 動漫時間:2022-10-27

魔眾系列系統目前已經有大量使用者在使用,大家對於偽靜態的配置一直有所疑惑,經過和技術小哥哥的協商,我們特意將三種不同的 HTTP 伺服器配置檔案分享給大家,方便大家參考。

魔眾系統偽靜態規則怎麼配

魔眾系列系統目前已經有大量使用者在使用,大家對於偽靜態的配置一直有所疑惑,經過和技術小哥哥的協商,我們特意將三種不同的 HTTP 伺服器配置檔案分享給大家,方便大家參考。

Nginx軟體

server {

listen 80;

server_name demo。tecmz。com;

charset utf-8;

index index。php index。html;

root /var/www/html/demo。tecmz。com/public;

autoindex off;

location ^~ /。git {

deny all;

}

location / {

try_files $uri $uri/ /index。php?$query_string;

}

location ~ \。php$ {

fastcgi_pass 127。0。0。1:9000;

fastcgi_index index。php;

fastcgi_param PHP_VALUE “open_basedir=/var/www/html/demo。tecmz。com/:/tmp/:/var/tmp/”;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

location ~ \。(gif|jpg|jpeg|png|bmp|ico|css|js)$ {

expires max;

}

location ~* \。(eot|ttf|woff|woff2)$ {

add_header Access-Control-Allow-Origin ‘*’;

}

}

Apache軟體

Options -MultiViews

RewriteEngine On

# Redirect Trailing Slashes If Not A Folder。。。

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(。*)/$ /$1 [L,R=301]

# Handle Front Controller。。。

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^ index。php [L]

IIS系統

標簽: index  fastcgi  PHP  location  filename