.htaccess - Url translate as request to another folder -
i need solution this:
i have domain: www.test.com
with document_root: /var/www/test.com/
i have web app placed in /var/www/test.com/apps/my-app/www
and need accesible www.test.com/apps/my-app/ without redirects , without www
htacces file:
rewritecond %{request_uri} ^/apps/my-app/ rewriterule ^(.*)$ apps/my-app/www/ [pt]
pages www.test.com/apps/my-app/whatever ok, when put url www.test.com/apps/my-app/ page redirects www.test.com/apps/my-app/www
thank you
you can use rule in /var/www/test.com/apps/my-app/.htaccess
:
rewriteengine on rewritebase /apps/my-app/ # if request not valid directory rewritecond %{request_filename} !-d # if request not valid file rewritecond %{request_filename} !-f rewriterule ^((?!www/).*)$ www/$1 [l,nc]
Comments
Post a Comment