首页 > 解决方案 > Laravel 仅在实时服务器上工作的“主页”路由

问题描述

我需要有关服务器上 URL 的帮助...

这是我的例子:

10.10.10.50/projectname/ - 工作 10.10.10.50/login - 不工作

10.10.10.50/项目名称/登录 - 工作

主要问题是,如果我单击页面上的某些内容,例如“登录”,它会指向 10.10.10.50/login,而不是 10.10.10.50/projectname/login

在 httpd.conf 文件中,我允许所有:

<Directory />
Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
</Directory>

这是我的 htaccess 文件:

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>     Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ / [L,R=301]
RewriteCond %{REQUEST_URI} !(\.css|\.js|\.png|\.jpg|\.gif|robots\.txt)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/ [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(css|js|images)/(.*)$ public// [L,NC]
</IfModule

谢谢

标签: laravelapacheurlserver

解决方案


推荐阅读