How to Redirect 404 to Home Page

How to Redirect 404 to Home Page

A simple way for v3Pro is:[list=1]

[]activate My Changes addon, if is not yet activated ;)

[
]copy code bellow to file skins/basic/customer/addons/my_changes/overrides/exception.tpl```php
<meta http-equiv=“refresh” content=“0;url={”“|fn_url}” />

[*]clear cache (?cc) in admin area<br />
[/list]<br />
<br />
Be careful this is a bad think for seo <img src="upload://ssa1U17ndImgNZSdwFNmOF2yUgM.png" class="bbc_emoticon" alt=";)"><br />
<br />
[ Tested on CS-Cart v.3.0.6 Professional ]<br />
<br />
I hope that helps,<br />
<br />
---<br />
Valentin<br />
[color=#808080][size=2]part of hungryweb.net[/size][/color]

Thank You

You are welcome.

[color=#333333][font=Arial][size=5]Redirect to a custom 404 error page[/size][/font][/color]



[color=#333333][font=Arial][size=3]1) Create a custom page in the root directory of your CS-Cart installation (or to redirect to the homepage, use index.php)[/size][/font][/color]

[color=#333333][font=Arial][size=3]2) In “fn.control.php” file located in the “core” directory of your CS-Cart installation, replace the following part of code:[/size][/font][/color]

[html] if ($status == CONTROLLER_STATUS_NO_PAGE) {

header(' ', true, 404);

}

[/html]



[color=#333333][font=Arial][size=3]with this one:[/size][/font][/color]



[color=#333333][font=Arial][size=3][html] if ($status == CONTROLLER_STATUS_NO_PAGE) {

fn_redirect(Registry::get('config.http_location') . “/NEWURL”);

}

[/html][/size][/font][/color]



[color=#333333][font=Arial][size=3]Note: In the new code, you would replace “NEWURL” with the name of the new page.[/size][/font][/color]

[color=#333333][font=Arial][size=3]Example, to redirect to the homepage:[/size][/font][/color]





[html] if ($status == CONTROLLER_STATUS_NO_PAGE) {

fn_redirect(Registry::get('config.http_location') . “/index.php”);

}

[/html]

thank you!

welcome

Hello,



We have developed “CS-Cart 404 custom redirect add-on” and installed more than 10+ CS-Cart website.



Please check here for more details.



Thankyou.