正在加载网站主页,其他所有网页均无效

时间:2018-06-02 20:26:03

标签: php .htaccess url apache2 http-status-code-404

我昨晚搞乱了我的网站,一切都很顺利。我去睡觉了,当我醒来时,我发现由于某种原因网站坏了。现在,我们的主页完整加载,但其他页面都没有加载。我恢复了我的Apache2.conf并重新启动了Apache2服务,并卸载了我在前一天晚上搞乱的SSL证书,但这些都没有解决它,尽管据我所知,它是在昨晚的同一状态当它全部工作时。

当我访问不是主页的页面时,我收到错误:

  

在此服务器上找不到请求的网址/css/site.css。

此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。

对于任何不是主页的页面,都会发生这种情况。就像我说的那样,我没有改变我的.htaccess,恢复了我的apache2配置,并解除了我昨晚搞砸了但仍无法弄清楚为什么我收到这条消息。非常感谢任何帮助,我可以在这个问题上添加任何必要的细节。

编辑:是否应该指定它不仅仅是CSS错误。例如,尝试访问'登录'我网站上的页面给出错误:

  

在此服务器上找不到请求的URL /登录信息。

此外,尝试使用ErrorDocument处理请求时遇到404 Not Found错误。

过去一周我没有遇到这个问题,我不知道为什么我现在得到它,假设它与我的apache2或htaccess有关,但不确定它会是什么。我没有更改任何codeigniter文件,也不相信CodeIgniter存在问题。

编辑2:我的.htaccess文件(域名已编辑)如下所示:

# ----------------------------------------------------------------------
# Environment Name
# ----------------------------------------------------------------------

# Sets the environment that CodeIgniter runs under.
 SetEnv CI_ENV development

# ----------------------------------------------------------------------
# UTF-8 encoding
# ----------------------------------------------------------------------

# Use UTF-8 encoding for anything served text/plain or text/html
AddDefaultCharset utf-8

# Force UTF-8 for a number of file formats
<IfModule mod_mime.c>
    AddCharset utf-8 .atom .css .js .json .rss .vtt .xml
</IfModule>

# ----------------------------------------------------------------------
# Rewrite engine
# ----------------------------------------------------------------------

# Turning on the rewrite engine is necessary for the following rules and features.
# FollowSymLinks must be enabled for this to work.
<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On

    # If you installed CodeIgniter in a subfolder, you will need to
    # change the following line to match the subfolder you need.
    # http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
    RewriteBase /


    # Checks to see if the user is attempting to access a valid file,
    # such as an image or css document, if this isn't true it sends the
    # request to the front controller, index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

    # Ensure Authorization header is passed along
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>


# ----------------------------------------------------------------------
# Gzip compression
# ----------------------------------------------------------------------

<IfModule mod_deflate.c>

    # Force deflate for mangled headers developer.yahoo.com/blogs/ydn/posts/2010/12/pushing-beyond-gzipping/
    <IfModule mod_setenvif.c>
        <IfModule mod_headers.c>
            SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
            RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
        </IfModule>
    </IfModule>

    <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE application/atom+xml \
                                      application/javascript \
                                      application/json \
                                      application/rss+xml \
                                      application/vnd.ms-fontobject \
                                      application/x-font-ttf \
                                      application/xhtml+xml \
                                      application/xml \
                                      font/opentype \
                                      image/svg+xml \
                                      image/x-icon \
                                      text/css \
                                      text/html \
                                      text/plain \
                                      text/x-component \
                                      text/xml
    </IfModule>
</IfModule>

0 个答案:

没有答案