【发布时间】:2021-01-26 19:27:38
【问题描述】:
我是初学者网络开发人员。 我有重定向的小问题。
我有这个过程:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://domain.pl [R=301,L]
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]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
一切正常。 现在我需要从https://domain.pl/index.php 和https://domain.pl.html 重定向到https://domain.pl
我使用 Laravel 8。
我该怎么做?
【问题讨论】:
-
这能回答你的问题吗? .htaccess rewrite url and removing .php