Yii App - Hosting In Godaddy Shared Hosting

I hosted my yii app in GoDaddy linux server(shared hosting). Any form submissions or redirection happens it suffix the webroot folder name to the baseurl. For example, I keep all the application folder in webroot/. "www.mydomain.com/index.php/site/index" is the url and after any redirect it becomes www.mydomain.com/mydomain/index.php/site/index. It gives 404 not found error.

Here mydomain is the folder name of webroot. I came through similar issues in many forums, i didn’t get any clear solution to this. I think it is a simple thing to do.

Please help me and thanks in advance.

my htaccess file

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 redirection code:

$this->redirect(array("Site/index"));

Hi,
Trust me it is a hosting issue, I can not recommend Godaddy any more, I know they provide a cheap hosting but the server they provide is horrible. However, I would suggest you to go with some reliable hosting provider so you can feel better. You can find out many many hosting providers on the internet, some of the providers are in my list:
ServerPilot, Cloudways, SiteGround, WPEngine. Their support are incredible.