2

I need to add the index controller name and the index action name in the url for example:

application.local will display the application.local/index/index (index controller, index action) In the url I need to display the full path: application.local/index/index

and

application.local/pages will display application.local/pages/index -I need to display the full path in the url: application.local/pages/index

It's like a 301 redirect, but I want to know if there is a possibility to do this form the framework and not form htaccess

1
  • bububaba's answer will work, but can you explain why you are needing this to occur in the first place? Commented Jun 12, 2012 at 20:12

1 Answer 1

1

One way to address this would be inspecting the URL (i.e. $request->getServer('REQUEST_URI')) and the dispatched controller and action ($request->getControllerName(), $request->getActionName()) to see if your criteria for redirecting are met. If so - do a redirect.

A good place to put this logic would be a FrontController plugin.

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

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.