使用htaccess重定向链接问题

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

我已经在子域上创建了一个opencart商店,我想知道是否有任何方法可以重定向页面,因为当我将商店字替换为任何它给我404 eror page not found

例如:http://XXX.XXX/store -----------> http://XXX.XXX/mobile(我收到404错误)

我如何摆脱opencart 3商店的404错误?

http-status-code-404
1个回答
0
投票

你可以像这样重定向

RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ http://example.net/$1 [L,R=301,NC]

其中example.com是旧域,example.net是新域

请分享您当前的.htaccess文件以获取更多详细信息

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