Reputation: 11275
I'm have couple of not used routes and searching for solutions to redirect this routes.
For example I have ['common/cart','affiliate/edit' ]
array of routes, and where I can add check to check If route is in this array redirect to 404 ? I think that can be done in /controller/common/seo_url.php
?
Upvotes: 0
Views: 791
Reputation: 1187
There are many places where you can add your redirection conditions, the most important thing is avoiding changing the code of core libraries, so I think that the best place would be in index.php
<OC_ROOT>/index.php
if (isset($request->get['route'])) {
$action = new Action($request->get['route']);
} else {
$action = new Action('common/home');
}
isset
part, you can check if the variable $request->get['route']
matches any of your obsolete routes and redirect on that basis, for example:if (isset($request->get['route'])) {
$ignored_routes = array('common/cart', 'affiliate/edit');
if(in_array($request->get['route'], $ignored_routes))
$action = new Action("error/not_found");
else
$action = new Action($request->get['route']);
} else {
$action = new Action('common/home');
}
/controller/common/seo_url.php
, what you want is <OC_ROOT>/system/engine/action.php
;)
Upvotes: 1