简体   繁体   English

Live Server 无法加载其他页面,出现 Apache 404 错误

[英]Live Server cannot load other pages with Apache 404 error

I'm using Google VM instances on Google Cloud Platform for running my live server.我在 Google Cloud Platform 上使用 Google VM 实例来运行我的实时服务器。 I'm also using CodeIgniter to build of my server.我也在使用 CodeIgniter 来构建我的服务器。 It can load the default route when entering the page but when going to other routes, it shows Apache 404 error:进入页面时可以加载默认路由,但进入其他路由时,显示Apache 404错误:

Not Found未找到

The requested URL was not found on this server.在此服务器上找不到请求的 URL。

Apache/2.4.29 (Ubuntu) Server at 35.186.147.249 Port 80 Apache/2.4.29 (Ubuntu) 服务器在 35.186.147.249 端口 80

My Apache config file at /etc/apache2/sites-available :我的 Apache 配置文件位于/etc/apache2/sites-available

<VirtualHost *:80>
    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html

    <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride All
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>

    ErrorLog /var/log/apache2/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

I looked up online and most people say it is an Apache problem but I'm not too sure.我在网上查了一下,大多数人说这是 Apache 问题,但我不太确定。 I'll share any of the files in order to fix this issue.我将共享任何文件以解决此问题。

The line DocumentRoot /var/www/html determinate the base of your files, I reviewed the IP that you put and i can see the next folder and access correctly:行 DocumentRoot /var/www/html 确定文件的基础,我查看了您放置的 IP,我可以看到下一个文件夹并正确访问:

  • j/日/
  • medical-survey/医疗调查/
  • temp/温度/

Here is the link to understand more about DocumentRoot, so you can define where you require the default folder route for your web files.这是了解有关 DocumentRoot 的更多信息的链接,因此您可以定义 Web 文件需要默认文件夹路径的位置。 In case you require to have different links of your web development you can follow this link to configure the virtual hosts.如果您需要不同的 Web 开发链接,您可以按照此链接配置虚拟主机。 Hope this is what you were looking for.希望这就是你要找的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Live Server上的Codeigniter 404错误 - Codeigniter 404 Error On Live Server Laravel API在实时服务器上收到404错误 - Laravel API receiving 404 error on live server Laravel 路由在实时服务器上导致 404 错误 - Laravel routes causing 404 Error on live server 实时服务器显示404错误,但不在本地,codeigniter 3上 - live server shows 404 error, but not on local, codeigniter 3 404未找到; Apache Server无法加载简单的php文件 - 404 Not Found; Apache Server can't load simple php file Codeigniter 网站在 Google Virtual Instant Live Server 上显示错误 404 - Codeigniter website showing error 404 on Google Virtual Instant Live Server 实时服务器网站中找不到404文件错误是基于Codeignitter框架的 - 404 file not found error in live server website is based on codeignitter framework 用户页面404错误 - 404 error with user pages Symfony 项目仅适用于主页。 当我导航到其他页面时,Apache 返回 404 - Symfony project works only homepage. When I navigate to the other pages Apache returns 404 (Apache:无法加载模块)httpd:C:/Apache24/conf/httpd.conf:Cannot load C:/php/php7apache2_4.Z0619AFZ31224AB5248C 的第 539 行出现语法错误 - (Apache : couldn't load module) httpd: Syntax error on line 539 of C:/Apache24/conf/httpd.conf:Cannot load C:/php/php7apache2_4.dll into server:
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM