|
Hi, I am just about relaunching a website and they gave out tons of QR Codes with links like: www.domain.com/detail.php?id=1234 What can I do to catch all this domains having the "details.php?Id=" and forward this to (controller=>detail action=>index, 1234) Is there a way to handle this with Router::connect rules? Thanks for any help! Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
Put this code ( modify it fit with your code ) in boostrap.php if (preg_match('/details\.php?id=(.*)/', $_SERVER['REQUEST_URI'], $match) !== false) { if (isset($match[1])){ $location = '/details/index/' . $match[1] header('Location: ' . $location, true, 301); die(); } } Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
CakePHP 2.0 has Router::redirect()
-- Thiago Belem Desenvolvedor Rio de Janeiro - RJ - Brasil
Assando Sites - Curso online de CakePHP assando-sites.com.br
thiagobelem.net [hidden email] Skype / gTalk » thiago.belem.web LinkedIn » br.linkedin.com/in/thiagobelem/pt On Tue, May 8, 2012 at 12:46 PM, Điển vũ <[hidden email]> wrote:
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
If I try this: (from the 2.0 book) Router::redirect( '/details*', array('controller' => 'qrcode', 'action' => 'redirect', array('persist' => true) )); I get this message:
The requested address '/details.php?id=4863' was not found on this server.
What is wrong with my Router? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
In reply to this post by heohni
Please help!!
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
In reply to this post by heohni
On Mon, May 14, 2012 at 1:08 PM, heohni
<[hidden email]> wrote: > If I try this: (from the 2.0 book) > > Router::redirect( > '/details*', > array('controller' => 'qrcode', 'action' => 'redirect', > array('persist' => true) > )); > > I get this message: > The requested address '/details.php?id=4863' was not found on this server. > > What is wrong with my Router? Are you trying to access /details.php?id=4863 as the url? That's not how cake works. Try going to /details or /details/4863 and see what happens then. Mike. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
Hi Mike, these urls /details.php?id=4863 are set in QR codes printed in a magazin. Now we plan to relaunch the new website made with cake. I want to catch these domains to forward them to the new "cake-style" target page. Therefore I need a way to lead the users to the requested target and not seeing a 404 error.
-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
In reply to this post by heohni
On Monday, May 14, 2012 7:08:36 PM UTC+7, heohni wrote:
You could try to use .htaccess to do this: RewriteCond %{QUERY_STRING} ^id=([0-9]*)$ RewriteRule ^details.php /qrcode/redirect/%1? [R=permanent,L] This will redirect details.php?id=1 to /qrcode/redirect/1. You might want to use the actual 'view' url instead of doing double redirection. Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
Hi, thanks, I will try! Which htaccess should I use, the one in /webroot/ On Monday, May 14, 2012 7:08:36 PM UTC+7, heohni wrote:-- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
|
I can answer this myself sorry! It works great! Thank you soooooooooooooooooooo much!!!! Am Mittwoch, 16. Mai 2012 11:47:43 UTC+2 schrieb heohni: -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to [hidden email] For more options, visit this group at http://groups.google.com/group/cake-php |
| Powered by Nabble | Edit this page |
