Php 使用服务器的Laravel 5路由
我在ftp服务器上安装了Laravel5。一切正常,主页已启用。但是我的路线有问题。链路正在调用路由,路由正在调用返回视图的控制器 我的链接: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 {
<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