My client has requested that they should be able to set the url text for pages they create on the site. They want to include keywords, whilst requiring the URLs be kept as short as possible. For example they require URLs like this:
localhost/computer-repairs-manchester
localhost/website-design-manchester
localhost/mobile-phones-north-west
So here we don’t include the controller name in the URL, however all the links belong to SiteController/actionPages(). The url text after ‘localhost’ is stored in a field ‘alias’ in the DB. This text does not contain any other parameters, so basically the controller action just needs to find the page from the ‘alias’ and display it.
What rule can I create to map these URLs to actionPages() ? Bear in mind there will potentially be hundreds of URLs like these, so the rule needs to be efficient.
So, has anybody tried out this extension - how well does it work?
How does it know that a URL belongs to a controller action (if typed in directly in the address bar)? What if I typed in mysite.com/invalid-page - would it give me a 404 page generated by sitecontroller or will it try to perform a match in the database and return an error from the controller action?