我已经有代码添加https。。。那么我该如何从url的末尾删除.php呢?这就是我的代码到目前为止的样子。
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
我还想把www
添加到url的前面。。。例如https://www.google.com
您可以像这样删除.php:
RewriteRule ^index index.php
然后您需要调用www.example.com/index
而不是www.example.com/index.php