http://test.mysite.com/aa
will cause to display
http://test.mysite.com/htmlroot/testdir/aa/
All other cases are working, except the one above.
I used this code:
- Code: Select all
RewriteCond %{HTTP_HOST} ^test\.mysite\.com$ [NC]
RewriteCond %{REQUEST_URI} !^/htmlroot/testdir [NC]
RewriteRule ^(.*) /htmlroot/testdir/$1 [L]
the rewrite rule log shows this:
(3) [per-dir C:/Work/mysite.com/] strip per-dir prefix: C:/Work/mysite.com/htmlroot/testdir/aa/ -> /htmlroot/testdir/aa/
(3) [per-dir C:/Work/mysite.com/] applying pattern '^(.*)' to uri '/htmlroot/testdir/aa/'
(4) RewriteCond: input='test.mysite.com' pattern='^test\.mysite\.com$' => matched
(4) RewriteCond: input='/htmlroot/testdir/aa/' pattern='!^/htmlroot/testdir' => not-matched
(1) [per-dir C:/Work/mysite.com/] pass through C:/Work/mysite.com/htmlroot/testdir/aa/
How to fix the rewrite rule so the
http://test.mysite.com/aa
should display
C:/Work/mysite.com/htmlroot/testdir/aa/
The following case also describes my goal:
My rules for that directory is as follows:
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{HTTP_HOST} ^sub.domain.com$
RewriteRule ^sub.domain.com$ /public_html/directory2use/ [R,L]
I want it that when the sub.domain.com is accessed it's document root will be at /public_html/directory2use, but the uri will be still... sub.domain.com/
Can anyone help me with htaccess file rules, if its incorrect?
Any suggestion to fix the problem?