我想使这些请求生效:
此刻,我正在使用PHP中的位置“修复”它,以在打开页面时重定向:
header("Location: ./");
但是我试图通过.htaccess来实现。
此刻我的htaccess就是这样,我最近尝试这样做:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
#redirect http to https, remove www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#redirect to index all php pages
RewriteCond %{THE_REQUEST} ^[^/]*/^(.*)$\.php [NC]
RewriteRule . /$1 [R=301,L]
#redirect to index
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
</IfModule>