[英]Laravel 6 redirecting to https://www.example.com/index.php when I press enter in the address bar with an address of www.example.com/profile?
I would think others are having the same issue.我认为其他人也有同样的问题。 I am on a shared server with Inmotion Hosting creating basic profile pages.
我在使用 Inmotion Hosting 创建基本配置文件页面的共享服务器上。 When I put my cursor up in the address bar for example the url ' https://www.example.com/profile ' and press enter Laravel brings up http://www.example.com/index.php which is a blank page.
当我将光标放在地址栏中时,例如 url ' https://www.example.com/profile ' 并按 Enter Laravel 会显示http://www.example.com/index.php这是一个空白页。 This only happens in Chrome.
这只发生在 Chrome 中。 I am guessing it may have to do with my .htaccess file?
我猜这可能与我的 .htaccess 文件有关? Below is that file.
下面是那个文件。 Any ideas?
有任何想法吗?
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^pollaclicks.com [NC]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
This link https://www.example.com/profile (considering it to be example) does not exists and hence it is redirected to http://www.example.com/index.php with reference to your example links and rules written in your .htaccess file.此链接https://www.example.com/profile (将其视为示例)不存在,因此参考您的示例链接和规则将其重定向到http://www.example.com/index.php写在你的 .htaccess 文件中。
In .htaccess file these rules are creating the issue :在 .htaccess 文件中,这些规则造成了问题:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [L]
It means that if the file with the specified name doesn't exist, or the directory doesn't exist then proceed to the rewrite rule below.这意味着如果指定名称的文件不存在,或者目录不存在,则继续下面的重写规则。
The [L]
flag causes mod_rewrite to stop processing the rule set [L]
标志导致 mod_rewrite 停止处理规则集
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.