laravel - 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
谢谢
解决方案
推荐阅读
- javascript - 如何用自定义按钮替换 PrimeFaces DataTable 分页?
- laravel - 为什么我不能成功使用 composer require {packageName}?
- c# - 为什么记录到 log4net.ILog 会附加到多个日志?
- amazon-cloudformation - IAM Cloudformation 模板最佳实践?
- c# - C#使用定时器控制程序
- ios - ld:通过 cocoapods 从 4.xx 升级到 5.xx firebase 后找不到框架 FirebaseAnalytics
- java - 使用 javac 编译失败,使用 eclipse-compiler 可以正常工作
- ruby-on-rails - 下载的 CSV 文件在 IE 中没有打开选项
- sql-server - 如何查找在 SQL SERVER 中提交的事务的机器 IP,我们有用户名和事务 ID
- node.js - expressjs - 在本地主机上提供供应商文件夹,但不在 heroku/otherhost 上