如何在不使用其他网址的情况下删除index.php并具有引荐301重定向

问题描述 投票:0回答:2

我正在使用此代码删除opencart的index.php。但是,还有其他地址:

/ index.php?route =帐户/注册

当然,代码开始在各处删除index.php。我的目标是由于内容重复而将其(index.php)删除以进行SEO。

我使用这个

Options +FollowSymLinks
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ https://website.com/$1 [R=301,L]
.htaccess redirect seo opencart opencart-3
2个回答
0
投票

要使用SEO URL,必须安装apache模块mod-rewrite,并且需要将htaccess.txt重命名为.htaccess

然后在Opencart的管理员内部转到System > Settings > Edit Store > Settings > Server > Use SEO URLs > YES


0
投票

不,不起作用:X,我只需要index.php ...当我进行此更改时,它只是开始切出其他地址。我只想隐藏index.php :)当有人加载确切的index.php之后没有其他变量时,请对该域进行引用。

© www.soinside.com 2019 - 2024. All rights reserved.