使用.htaccess将web Url更改为另一个Url


change web Url to another Url using .htaccess?

我有centos服务器,我想在地址栏中看到我的网址与/index.php

当我试图访问我的网站www.example.com时,我想在地址栏中看到网页的url应该是www.example.com/index.php

我希望它将通过配置。htaccess文件工作。我不熟悉。htaccess。

RewriteRule ^$ /index.php [L,R=301]

如果index.php在DirectoryIndex列表中,那么您正在进行不必要的重定向/重写。