Note that there are some explanatory texts on larger screens.

plurals
  1. POCakephp, Route old google search results to new home page
    primarykey
    data
    text
    <p>I have created a new website for a company and I would like all the previous search engine results to be redirected. Since there were quite a few pages and most of them where using an id I would like to use something generic instead of re-routing all the old pages. </p> <p>My first thought was to do that: </p> <pre><code>Router::connect('/*', array('controller' =&gt; 'pages', 'action' =&gt; 'display', 'home')); </code></pre> <p>And put that at the very end of the routes.php file <em>[since it is prioritized]</em> so that all requests not validating with previous route actions would return true with this one and redirect to homepage. </p> <p>However this does not work.</p> <p>When I use a different path on the Router it redirects successfully. For example if I give it:</p> <pre><code>Router::connect('/*', array('controller' =&gt; 'projects', 'action' =&gt; 'browser')); </code></pre> <p>it works fine. The problem arises when the controller used is pages, action display etc. </p> <p>I'm pasting my routes.php file <em>[since it is small]</em> hoping that someone could give me a hint: </p> <pre><code> Router::connect('/', array('controller' =&gt; 'pages', 'action' =&gt; 'display', 'home')); Router::connect('/company/*', array('controller' =&gt; 'articles', 'action' =&gt; 'view')); Router::connect('/contact/*', array('controller' =&gt; 'contacts', 'action' =&gt; 'view')); Router::connect('/lang/*', array('controller' =&gt; 'p28n', 'action' =&gt; 'change')); Router::connect('/eng/*', array('controller' =&gt; 'p28n', 'action' =&gt; 'shuntRequest', 'lang' =&gt; 'eng')); Router::connect('/gre/*', array('controller' =&gt; 'p28n', 'action' =&gt; 'shuntRequest', 'lang' =&gt; 'gre')); Router::parseExtensions('xml'); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload