访问以下任何链接都可以正常工作,并且网址中没有/index.php
。当通过HTTP查看网站时,URL显示URL中的/index.php,但使用HTTPS时不显示网址
但是,如果您尝试使用HTTP访问该网站,你会被重定向到HTTPS版本,但会有在URL /index.php
现在。我如何摆脱这一点?
这里是我的.htaccess
文件:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
#get rid of index.php in home
RedirectMatch 301 ^/index.php/(.*)$ https://kdev.solutions/$1
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# redirect to HTTPS
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
</IfModule>
当我在地址栏中输入“kdev.solutions”或“www.kdev.solutions”时,我仍然在URL中获得'/ index.php'。 – Attila