We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Not Beautiful URLs

Is there a way to disable Beautiful URLs and work with simple urls like index.php?r=index/help ?? And generate that links by url() function in view



5.0k
Accepted
answer
edited Mar '14

My 2 cents:

  1. Don't use the .htaccess
  2. Set the baseUri in your url resource ($di->set('url', function() { .....)

see: https://docs.phalcon.io/en/latest/reference/url.html#producing-urls-without-mod-rewrite

<?php
$di->set('url', function() {
  $url = new Phalcon\Mvc\Url();

  //Pass the URI in $_GET["_url"]
  $url->setBaseUri('/index.php?r=/');

  return $url;
});