小编som*_*h72的帖子

删除版本字符串查询(主 style.css 除外)

我尝试删除除主样式表之外的所有版本字符串查询,因为我经常更新样式表,并且我希望每次更新时都刷新它(通过手动添加其版本)

这是我删除版本的方法

function vc_remove_wp_ver_css_js( $src ) {
    if ( strpos( $src, 'ver=' ) )
        $src = remove_query_arg( 'ver', $src );
    return $src;
}
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 );
Run Code Online (Sandbox Code Playgroud)

如何添加异常,以便 main style.css 仍会显示其版本

谢谢

html css php wordpress

4
推荐指数
1
解决办法
666
查看次数

Try_files for php导致fastcgi-php.conf错误,"try_files"指令在/etc/nginx/snippets/fastcgi-php.conf:5中重复

我试图添加try_files来检查php文件是否存在,但它给了我错误.

"try_files" directive is duplicate in /etc/nginx/snippets/fastcgi-php.conf:5
Run Code Online (Sandbox Code Playgroud)

这里我要添加try_files的位置

location ~ \.php$ {
    try_files $uri =404;
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/run/php/php7.0-fpm-user.sock;
}
Run Code Online (Sandbox Code Playgroud)

这是我的竞争服务器块.

server {
    listen 80;
    server_name www.example.com example.com;
    return 301 https://example.com$request_uri;
}



server {
    listen 443 ssl;
    server_name www.example.com;
    ssl_certificate /home/user/ssl/example.com.ssl-bundle.crt;
    ssl_certificate_key /home/user/ssl/example.com.key;
    return 301 https://example.com$request_uri;
}



server {
    listen 443 ssl;

    root /home/user/public_html;
    index index.php index.html index.htm index.nginx-debian.html;

    server_name example.com;
    ssl_certificate /home/user/ssl/example.com.ssl-bundle.crt;
    ssl_certificate_key /home/user/ssl/example.com.key;

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

    location = /robots.txt {
        allow all; …
Run Code Online (Sandbox Code Playgroud)

php nginx

1
推荐指数
1
解决办法
2714
查看次数

标签 统计

php ×2

css ×1

html ×1

nginx ×1

wordpress ×1