宝塔 Nginx 食用 php 版 jsproxy

2020-05-09  本文已影响0人  Pixcat

源码

备份  |  出处

伪静态

if (!-f $request_filename){

set $rule_0 1$rule_0;

}

if (!-d $request_filename){

set $rule_0 2$rule_0;

}

if ($rule_0 = "21"){

rewrite ^/?http/(.*?)/?$ /index.php?url=$1 last;

}

修改配置

设置404页面

server{

error_page 404 /404.html;

    location = /404.html {

        root /www/wwwroot/站点目录;

    }


Apache

设置默认404页

更改 404.html404.stml 

.htaccess 伪静态

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^/?http/(.*?)/?$ /index.php?url=$1 [L]

## 跳转到 https

RewriteEngine On

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://域名/$1 [R,L]

## 设置默认首页优先级

DirectoryIndex index.html index.php

上一篇下一篇

猜你喜欢

热点阅读