I’m in the process of learning Yii and working with the latest basic app example. It looks like using enblePrettyUrl always means that requests using ?r= will no longer work. Is that right? That would include the normal way to access Gii via ?r=gii. I want to confirm that the only way to access Gii becomes adding a new URL rule for Gii as described in the API docs for Class yii\gii\Module. (I don’t thing I’m allowed to post links yet, so sorry for their absence.)
Old routes should work. Also when pretty URLs are allowed Gii is available as /gii w/o adding extra rules. Rules are needed in case you’re enabling string parsing.
Thanks for the response. I see that /gii works–nice tip. Are you saying that my ?r= routes should still work? Once I change to pretty URL’s, I just get redirected to the index page, and the debugger log says “No matching URL rules. Using default URL parsing logic.” Here’s my setup:
These are the only changes I have made to the basic app. In /config/web.php I added this to the components section:
This is my .htaccess content, as found in the Installation doc:
RewriteEngine on
# If a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward it to index.php
RewriteRule . index.php
My web root is /web. Before I add the urlManager block, then when I click on the About page link, it looks like this: /index.php?r=site/about . I can access Gii with /index.php?r=gii . As soon as I add the urlManager section to /config/web.php, then none of the following URLs will work:
/index.php?r=gii
/index.php?r=site/about
/?r=gii
/?r=site/about
The About page works at /site/about, and as you suggested, Gii works at /gii. Is there something different about the way I have this set up, or did I just misunderstand about the ?r= routes?