Apache Web服务器配置提供404错误消息

时间:2014-07-25 23:21:42

标签: php .htaccess laravel laravel-4

配合, 我一直在寻找,但仍无法找到解决方案。

我在apache2.conf

上有这个
<Directory /home/pablo/htdocs/elementalguru/cuentas/idpetecuador.com/www/system/public>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

这是000-default.conf

<VirtualHost *:80>
    # The ServerName directive sets the request scheme, hostname and port that
    # the server uses to identify itself. This is used when creating
    # redirection URLs. In the context of virtual hosts, the ServerName
    # specifies what hostname must appear in the request's Host: header to
    # match this virtual host. For the default virtual host (this file) this
    # value is not decisive as it is used as a last resort host regardless.
    # However, you must set it for any further virtual host explicitly.
    # ServerName localhost

    ServerAdmin webmaster@localhost
    DocumentRoot /home/pablo/htdocs

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "/home/pablo/htdocs/elementalguru/cuentas/idpetecuador.com/www/system/public"
    ServerName eguru.idpet.sys
</VirtualHost>

公用文件夹上的.htaccess文件是这样的:

<IfModule mod_rewrite.c>
    Options -MultiViews
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

但是当我尝试访问类似

的网址时
http://eguru.idpet.sys/clinicas

主机文件中说明了这一点。

我收到404错误消息。

知道为什么吗? 提前谢谢!

1 个答案:

答案 0 :(得分:0)

您的mod_rewrite已启用吗?

尝试$ a2enmod rewrite,然后重新启动apache。

以下是laravel/laravel .htaccess,您试过这个吗?

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>

    RewriteEngine On

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
相关问题