0

I need to reroute a url here. I'm using teh end framework and need to set up some basic static pages here. LIke privacy policy, advertise etc - however the problem is that I need to create a controller for each and every page here. Thats not much of an issue but I was wondering if its possibel for me to set it up so:

mysite.com/privacy/index

would be rerouted to

mysite.com/pages/privacy

Might sound like a non issue but would like to know

2 Answers 2

2

For every static page, you can add a route for it in your application.ini. For example, for mysite.com/privacy/index you can do:

resources.router.routes.privacy.route = "/privacy/index"
resources.router.routes.privacy.defaults.module = default
resources.router.routes.privacy.defaults.controller = pages
resources.router.routes.privacy.defaults.action = privacy

More about routing in ZF is in the ZF's manual. Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

1

From my experience I would STRONGLY discourage creating custom routes if not 100% needed (exception be urls with keywords for products or CMS generated pages). We wanted to our ecommerce solution to have nice urls like /about-us/ instead of /pages/about-us/, but it's PITA to add any more features, as you had to add new route for every such thing. We currently have like 25 custom routes. You can never tell what the hack the url is because standard-url like producer/index is routed from something like producers.

If you still want it, follow Marcin's answer :)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.