Forum Moderators: phranque

Message Too Old, No Replies

I can only reach index.php and no other file!

         

xpucto

10:33 pm on Feb 17, 2006 (gmt 0)

10+ Year Member



when I try to reach different pages on my website I only get to see index.php. No matter if I write: wwWebmasterWorldebsite.com/page1.html or wwWebmasterWorldebsite.com/page2.php, I only get to see index.php.
only if I write my IP-address instead of the hostname, then I get to see the page I want.
What do I do wrong?
Thanks for any help. I'm trying around since a few hours now!

XpucTo

jdMorgan

12:10 am on Feb 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



xpucto,

Welcome to WebmasterWorld!

We need a lot more information:

Did it work before? If so, what changed?
Is this a new hosting account?

Please tell us about your situation.

Jim

xpucto

3:35 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



Hi Jim!
I just got a virtual server. I gave the IP addresse for the webpointing and hier is the virtualhost configuration:

<VirtualHost *>
DocumentRoot /home/WebmasterWorldebsite.com
</VirtualHost>

and NameVirtualHost 00.00.00.00 (my IP)

What did I do wrong?

xpucto

5:13 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



Ok I forgot to mention that I also have the ServerName in my VirtualHost.
Actually when I just give my IP address, I get the index.php from the first virtualhost. Shouldn'I get the index.php from the DocumentRoot (/home) that I defined outside the virtualhost?
my ipf.conf looks like this right now:

DocumentRoot /home
NameVirtualHost 00.00.00.00

<VirtualHost *>
ServerName www.example.com
DocumentRoot /home/example.com
</VirtualHost>

<VirtualHost *>
ServerName www.example2.com
DocumentRoot /home/example2.com
</VirtualHost>

So if i type 00.00.00.00.00 I get the index.php of my example.com instead of the one from my DocumentRoot. And if I type 0.00.00.00.00/example.com/index.php, it doesn't find anything.
my webpointing is www.example.com -> myIP

xpucto

5:46 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



Ok, I think apache just take the DocumentRoot from the 1st DocumentRoot and shows one of the file in it, and doesn't show any other file or any subdirectory.

xpucto

6:52 pm on Feb 18, 2006 (gmt 0)

10+ Year Member



I tried further:
the errorlog says only
File does not exist: /home/favicon.ico

/home being my DocumentRoot. I don't understand why it is looking for this file!
Nothing works as expected! I really don't understand why beacause I've already done this before with no problem.

Now I've diseabled all my virtualhosts.

So http://www.example.com and http://www.example2.com are pointing to my IP addresse, DocumentRoot is /home, ServerName is my IP (I tried also with nothing) and that's it I guess.

When I typed now http://www.example.com or http://www.example2.com I get index.html that is located in /home (my DocumentRoot), this is correct, BUT if I give
www.example(2).com/anotherindex.html or www.example(2).com/subdir/file.php, then I still get this index.html!

[edited by: jdMorgan at 7:35 pm (utc) on Feb. 18, 2006]
[edit reason] formatting [/edit]

jdMorgan

7:40 pm on Feb 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When Apache cannot determine the correct virtual host, it chooses the default - the first virtualhost in the list. So, your configuration is incorrect, and Apache is selecting the default server.

I'd suggest that you try one of the example configurations given in the Apache Name-based Virtual Host Support [httpd.apache.org] document and the documents that it links to.

After you get it working, then modify it and test one step at a time to suit your needs.

Jim