Godaddy & YII2

I have successfuly installed YII2 basic template at my account in godaddy.com,

I´m accessing the application at http://myhost.com/basic/web

But I tried to use .htaccess to access via http://myhost.com as described at yii2 guide.

I was not clear to me the right place to put .htaccess




Options +FollowSymLinks

IndexIgnore */*


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



Any help would me appreciated

If your webserver is Apache you’ll need to add an .htaccess file with the following content to web (or public_html or whatever) (where the index.php file is located):


Options +FollowSymLinks

IndexIgnore */*


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

In case of nginx you should not need any extra config files.