Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/294.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用服务器的Laravel 5路由_Php_Apache_.htaccess_Laravel_Laravel 5 - Fatal编程技术网

Php 使用服务器的Laravel 5路由

Php 使用服务器的Laravel 5路由,php,apache,.htaccess,laravel,laravel-5,Php,Apache,.htaccess,Laravel,Laravel 5,我在ftp服务器上安装了Laravel5。一切正常,主页已启用。但是我的路线有问题。链路正在调用路由,路由正在调用返回视图的控制器 我的链接: <div class="logo"><a href="{{ route('accueil') }}"><img src="images/logo.png" alt=""></a></div> 我的控制器: class ControllerTest extends Controller {

我在ftp服务器上安装了Laravel5。一切正常,主页已启用。但是我的路线有问题。链路正在调用路由,路由正在调用返回视图的控制器

我的链接:

<div class="logo"><a href="{{ route('accueil') }}"><img src="images/logo.png" alt=""></a></div>
我的控制器:

class ControllerTest extends Controller
{
    public function accueil()
    {
        return view('accueil');
    }

}
但当我查看我的元素时,我可以看到:href=”http://XX.XXX.XX.XXXC:/test/public/index.php“而不是href=”http://XX.XXX.XX.XXX/test/public/index.php"

看起来Laravel正在混合服务器的IP和本地主机。我找不到哪里不对劲。我在网上搜索了一个解决方案,但我总是有这个问题

/public文件夹中有我的.htaccess文件

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

RewriteEngine On
RewriteBase /test

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

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L]
我不明白为什么它不能工作。如果有人有办法帮我


谢谢阅读。

当然应该是httpd配置中的
c:\
而不是
c://
?我在文件中更改了它。然后,我重新启动了Apache,但仍然存在相同的问题:href=“”
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews
</IfModule>

RewriteEngine On
RewriteBase /test

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

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /index.php [L]
<VirtualHost *:80>
  DocumentRoot C:/htdocs
  RewriteEngine On
  RewriteOptions Inherit 
  <Directory "C:/htdocs">
    AllowOverride All
    Order allow,deny
    Allow from all
    Require all granted
  </Directory>
</VirtualHost>
LoadModule rewrite_module modules/mod_rewrite.so