Hi to all.
I need help with this. I’ve been searching everywhere and can’t find a solution. It seems simple what I want to do, but can’t get it to work.
I have my app in a subfolder named ‘app’ in my local htdocs and the same folder in the hosting server. I can reach my app going to: localhost/app or mydomain.com/app and everything works perfect
The thing I can’t achieve is that I want the app to remain in that folder (public_html/app), and make everything appear as if it was directly on the public_html, that means going to mydomain.com and seeing urls like: mydomain.com/site/contact and NOT like: mydomain.com/app/site/contact
My url manager is as follows:
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive' => true,
'useStrictParsing'=>true,
'rules'=>array(
''=>'site/index',
'post/<id:\d+>/<urlName:[a-z0-9-]+>'=>'post/view',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
I also have an .htaccess file under the ‘app’ folder with the following:
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
I’ve seen some complex directory structures like the one here where index.php is inside: frontend/www so I guess that what I am asking is possible.
Any help is really welcome!!!
Thanks in advance
Smith B