当前位置:论坛首页 > Linux面板 > 求助

站点的默认页设置不起作用

发表在 Linux面板2018-6-15 09:29 [复制链接] 5 3455

我的网站默认页想设置成:
default.html
default.htm
default.php
index.html
index.htm
index.php

但是网站打开时始终执行的是index.php
我的网站根目录放有default.html导航页,
输入”域名/default.html“可以正常打开导航页
输入”域名/“直接打开的就是index.php

把default.html改成index.html也执行不到

无论怎么改,执行的都是index.php

使用道具 举报 只看该作者 回复
发表于 2018-6-15 09:31:52 | 显示全部楼层
在当前网站的一个配置文件中  root 上面那一行有一个  东西。  
里面是 index.php index.html 你可以看看
使用道具 举报 回复 支持 反对
发表于 2018-6-15 09:38:54 | 显示全部楼层
网站配置文件

<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "/www/wwwroot/www.easy-core.com"
    ServerName cbd081ce.www.easy-core.com
    ServerAlias www.easy-core.com easy-core.com
    errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/www.easy-core.com-error_log"
    CustomLog "/www/wwwlogs/www.easy-core.com-access_log" combined
    #HTTP_TO_HTTPS_START
    <IfModule mod_rewrite.c>
        RewriteEngine on
        RewriteCond %{SERVER_PORT} !^443$
        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]
    </IfModule>
    #HTTP_TO_HTTPS_END
    #SECURITY-START 防盗链配置
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$ [NC]
    RewriteCond %{HTTP_REFERER} !www.easy-core.com [NC]
    RewriteCond %{HTTP_REFERER} !easy-core.com [NC]
    RewriteRule .(jpg|jpeg|gif|png|js|css|swf|pdf|doc|docx|xls|xlsx|xlsm|rar|zip|7z) /404.html [R=404,NC,L]
    #SECURITY-END
                           
    #DENY FILES
     <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
       Order allow,deny
       Deny from all
    </Files>
   
    #PHP
    <FilesMatch \.php$>
            SetHandler "proxy:unix:/tmp/php-cgi-71.sock|fcgi://localhost"
    </FilesMatch>
   
    #PATH
    <Directory "/www/wwwroot/www.easy-core.com">
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex default.html default.htm default.php index.html index.htm index.php
    </Directory>
</VirtualHost>
<VirtualHost *:443>
    ServerAdmin webmasterexample.com
    DocumentRoot "/www/wwwroot/www.easy-core.com/"
    ServerName SSL.www.easy-core.com
    ServerAlias www.easy-core.com easy-core.com
    errorDocument 404 /404.html
    ErrorLog "/www/wwwlogs/www.easy-core.com-error_log"
    CustomLog "/www/wwwlogs/www.easy-core.com-access_log" combined
   
    #SSL
    SSLEngine On
    SSLCertificateFile /etc/letsencrypt/live/www.easy-core.com/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/www.easy-core.com/privkey.pem
    SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
    SSLProtocol All -SSLv2 -SSLv3
    SSLHonorCipherOrder On

    #HTTP_TO_HTTPS_END
    #SECURITY-START 防盗链配置
    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$ [NC]
    RewriteCond %{HTTP_REFERER} !www.easy-core.com [NC]
    RewriteCond %{HTTP_REFERER} !easy-core.com [NC]
    RewriteRule .(jpg|jpeg|gif|png|js|css|swf|pdf|doc|docx|xls|xlsx|xlsm|rar|zip|7z) /404.html [R=404,NC,L]
    #SECURITY-END

    #PHP
    <FilesMatch \.php$>
            SetHandler "proxy:unix:/tmp/php-cgi-71.sock|fcgi://localhost"
    </FilesMatch>
   
   
    #DENY FILES
     <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>
       Order allow,deny
       Deny from all
    </Files>
   
    #PATH
    <Directory "/www/wwwroot/www.easy-core.com/">
        SetOutputFilter DEFLATE
        Options FollowSymLinks
        AllowOverride All
        Require all granted
        DirectoryIndex default.html default.htm default.php index.html index.htm index.php
    </Directory>
</VirtualHost>
使用道具 举报 回复 支持 反对
发表于 2018-6-15 10:01:17 | 显示全部楼层
查看附件图片设置
TIM图片20180615100035.png
使用道具 举报 回复 支持 反对
发表于 2018-6-15 10:29:10 | 显示全部楼层

这里有设置,default.html是放在最顶上,
但是不起作用,不管怎么设置执行的都是index.php-->index.html
使用道具 举报 回复 支持 反对
发表于 2018-6-15 13:35:10 | 显示全部楼层
liang2580 发表于 2018-6-15 09:31
在当前网站的一个配置文件中  root 上面那一行有一个  东西。  
里面是 index.php index.html 你可以看看 ...

DirectoryIndex default.html default.htm default.php index.html index.htm index.php

不行,配置文件都检查过
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表