PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, April 22, 2022

[FIXED] How to rewrite URL in CakePHP

 April 22, 2022     cakephp, cakephp-2.3, php, url-rewriting     No comments   

Issue

I am using Cake 2.3 and I have a URL like this:

http://www.example.com/events/event_name

I want to show

http://www.example.com/event_name

I have gone through many links but with no success I am posting here. Please help me in this.


Solution

As mentioned in cakephp official documentation you can use Router class in your bootstrap.php file like

Router::redirect('/posts/*', 'http://google.com', array('status' => 302));


Answered By - ReZa
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing