htaccess 从 url/folder 中删除 index.php
htaccess remove index.php from url/folder
我有问题,无法在 Internet 上找到可行的解决方案。所以希望你能帮助我。
我需要让我的网站尽可能地对 SEO 友好。因此我需要更改以下内容
https://www.example.com/index.php
https://www.example.com/folder/index.php
https://www.example.com/folder/folder/index.php
收件人:
https://www.example.com/
https://www.example.com/folder/
https://www.example.com/folder/folder/
我需要某种规范的重定向,以便只有在没有 /index.php 的情况下才能访问我的网站,以消除重复内容。
我想使用 .htaccess。很感谢任何形式的帮助。
提前致谢。
只需在主域 (www.example.com/) 中创建 .htaccess 并放入下面的代码。
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]
我有问题,无法在 Internet 上找到可行的解决方案。所以希望你能帮助我。
我需要让我的网站尽可能地对 SEO 友好。因此我需要更改以下内容
https://www.example.com/index.php
https://www.example.com/folder/index.php
https://www.example.com/folder/folder/index.php
收件人:
https://www.example.com/
https://www.example.com/folder/
https://www.example.com/folder/folder/
我需要某种规范的重定向,以便只有在没有 /index.php 的情况下才能访问我的网站,以消除重复内容。
我想使用 .htaccess。很感谢任何形式的帮助。 提前致谢。
只需在主域 (www.example.com/) 中创建 .htaccess 并放入下面的代码。
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.php($|\ |\?)
RewriteRule ^ /%1 [R=301,L]