Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Fri Feb 08, 2008 12:05 am 
Offline
Senior Newbie

Joined: Wed Feb 06, 2008 1:22 am
Posts: 8
Website: http://www.estradasphere.com
AOL: dethmetalmachine
Location: Seattle, WA
Hello! I have recently installed the mod_rewrite module, and configured it so when someone enters a subdomain (test.domain.com) they are transparently directed to domain.com/test/. It works okay, but when arriving at the destination, it claims it cannot find index.html there.

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!


Top
   
 Post subject:
PostPosted: Fri Feb 08, 2008 2:16 pm 
Offline
Junior Member

Joined: Sun Dec 02, 2007 1:17 am
Posts: 27
Website: http://www.nabber.org
Can you post the actual rewrite rules you are using?


Top
   
 Post subject:
PostPosted: Fri Feb 08, 2008 6:14 pm 
Offline
Senior Newbie

Joined: Wed Feb 06, 2008 1:22 am
Posts: 8
Website: http://www.estradasphere.com
AOL: dethmetalmachine
Location: Seattle, WA
Here is the full text of my main .htaccess file

DirectoryIndex index.html index.php index.htm
RewriteEngine On
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^(www\.)?callsteward\.com$ [NC]
RewriteCond %{HTTP_HOST}<->%{REQUEST_URI} ^(www\.)?([^.]+).*<->/([^/]+) [NC]
RewriteCond %2<->%3 !^(.*)<->\1$ [NC]
RewriteRule ^(.+) /%2/$1 [PT,L]


Top
   
 Post subject:
PostPosted: Fri Feb 08, 2008 10:29 pm 
Offline
Junior Member

Joined: Sun Dec 02, 2007 1:17 am
Posts: 27
Website: http://www.nabber.org
what happens if you change it to?

DirectoryIndex index.php index.html index.htm


Top
   
 Post subject:
PostPosted: Fri Feb 08, 2008 10:39 pm 
Offline
Senior Newbie

Joined: Wed Feb 06, 2008 1:22 am
Posts: 8
Website: http://www.estradasphere.com
AOL: dethmetalmachine
Location: Seattle, WA
The same exact thing happens.

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.


Top
   
 Post subject:
PostPosted: Fri Feb 08, 2008 10:42 pm 
Offline
Senior Newbie

Joined: Wed Feb 06, 2008 1:22 am
Posts: 8
Website: http://www.estradasphere.com
AOL: dethmetalmachine
Location: Seattle, WA
Well, it seems that the index being searched for is the original index that would have matched had the main server been hit. Right now, the www subdomain has as its index a file called index.html, so i guess when any subdomain is reached, it looks for that for some reason.

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?


Top
   
 Post subject:
PostPosted: Sat Feb 09, 2008 1:23 pm 
Offline
Newbie

Joined: Sun Dec 30, 2007 10:06 pm
Posts: 3
Running a google search for what you appear to be wanting to do
( mod-rewrite + subdomain to dir )

Yielded:
http://www.webmasterworld.com/apache/3448467.htm
where they talked about using mod_alias and talk about
Quote:
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...

_________________
BOFH excuse #299:
The data on your hard drive is out of balance.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group