rewrite is directing people to the wrong index page?
There is an index.php in there, shouldn't that be picked up too? I even went into /test/ and made an .htaccess file that says DirectoryIndex index.php. When i access the page via domain.com/test/, the index loads fine. When I go through test.domain.com, it says 'index.html is not found, bleh bleh'.
I need to know where the discrepancy here is being introduced, so I can fix it! Thanks!
6 Replies
DirectoryIndex index.html index.php index.htm
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^(www.)?callsteward.com$ [NC]
RewriteCond %{HTTPHOST}<->%{REQUESTURI} ^(www.)?([^.]+).*<->/([^/]+) [NC]
RewriteCond %2<->%3 !^(.*)<->\1$ [NC]
RewriteRule ^(.+) /%2/$1 [PT,L]
DirectoryIndex index.php index.html index.htm
Really, I did think of that, and had already tried it. The fact that I can navigate to the directory and have the .htaccess direct me to the .php page is proof that the DirectoryIndex line is not malconstructed.
It is something that is introduced when the subdomain is used.
Changing that to index.php means that every subdomain is now looking for that filename as the default. So it works.
Can anyone tell me where this behavior is controlled? Is this an effect of the rewrite file i'm using?
( mod-rewrite + subdomain to dir )
Yielded:
http://www.webmasterworld.com/apache/3448467.htm
where they talked about using mod_alias and talk about
> and the original address of
http://wiki.example.com/ would permanently redirect to
http://www.example.com/wiki/
It's worth a look anyway :>
All the best…