.htaccess mod rewrite

hi, im on shared server.

so in my dir /domains/public_html/ i have the following directories:

.htaccess

yiiRoot

projectDir

      /assets


      /css


      ....


      /protected


      /.htaccess


      /index.php

so currently, for .htaccess that resides in public_html, the content is:


Options +FollowSymLinks

RewriteEngine On


RewriteCond %{HTTP_HOST} ^(www\.)?domain.com$ [NC]

RewriteCond %{DOCUMENT_ROOT}/projectDir%{REQUEST_URI}/ -d

RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]


RewriteCond %{ENV:REDIRECT_STATUS} ^$

RewriteCond %{HTTP_HOST} ^(www\.)?domain.com$ [NC]

RewriteRule ^(.*)$ /projectDir/$1 [QSA,L]

but im getting http://domain.com/projectDir/ as my url. how can i remove projDir??

It’s because of this line in .htaccess


Rewriterule ^(.*)$  projectDir/index.php/$1/

you can change it to


Rewriterule ^(.*)$  index.php/$1/

actually, i updated my configuration in my prev post.

but i tried your changes and its still not working. :(

i changed from


RewriteRule ^(.*)$ /projectDir/$1 [QSA,L] to RewriteRule ^(.*)$ /index.php/$1 [QSA,L]

I’m having the same problem. Any resolution to this?

What is your Yii basepath set to?

Does the problem only appear on Yii created Urls?