Hi,
I want my posts url to be like this:
example.com/post-slug
so I added the routing rule on routes.php like this
Router::connect('/*', array('controller' = 'posts', 'action' = 'view'));
It works well but other links give 404 error like this one
Error: The requested address
A few things come to my mind off the top off my head.
You could route your controller-action url's first, to catch the actual
links such as /members/users/login (is members a prefix, or do you have a
users method with login parameter, or do you have that as a custom route?)
Then providing you
Hi Stephen,
s members a prefix, or do you have a users method with login parameter, or
do you have that as a custom route?
Yes, members is a prefix but the problem also exists with urls without
prefix like /pages/display/about
I found a post on Mark Story's blog that is talking about my
The link you gave me is done a little differently to how you are doing it
now, all the post is introducing is a new method to parse the route itself.
Normally you may have something like /posts/view/slug which may be public
function view($slug = null), then you may execute a query to find the
But other links like /pages/display/about gave me 404 error as it routes to
posts controller not pages controller.
Thanks
On Friday, January 3, 2014 10:07:23 PM UTC+2, Stephen S wrote:
The link you gave me is done a little differently to how you are doing it
now, all the post is
Hey, that was just a test to see if those two routes were working, am I
right in assuming the members one worked and the posts one worked, but all
your others did not?
All you need to do is setup routes *before* the posts route to catch the
ones which are currently broken, you can specifically