LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-17-2004, 08:50 PM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Rep: Reputation: 32
VirtualHost settings


Hi all

can any one help me out please

we are trying to load a index.html file first then it kicks you to a index.php
both files are in the root of the DIR, ( /var/www/html )
and i cant seem to get it going, any ideas please
OS is FC 2


My settings are now
Code:
<VirtualHost *:80>
    ServerAdmin webmaster@my_mail.com
    DocumentRoot /var/www/html/
    ServerName my_site.com
</VirtualHost>
I tried this which gave me an error
Code:
<VirtualHost *:80>
    ServerAdmin webmaster@my_mail.com
    DocumentRoot /var/www/html/index.html
    ServerName my_site.com
</VirtualHost>
TT
 
Old 08-17-2004, 10:06 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Your virtual hosts have nothing to do most likely for redirecting your site from an index.html page.. If they are different domans or sites, well then, get the virtual domains to work.. and then just make a meta refresh tag to redirect after a second or so to the new or other page..

If your trying to setup two domains and same site in two different directories with two different virtual hosts, I really don't see the point.. why not just make it so your server recognizes index.php files as index type files and have it just go directly to that site or page..

More information on why your doing this and more details on what your actually trying to accomplish? Seems to me you just trying to go on with a very complex way, when it should be very simple.
 
Old 08-17-2004, 10:12 PM   #3
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
ok

I have a index.html file in the root ( /var/www/html ) of my DIR were also my index.php is which is our main site.

I was wondering if i can get the domain name to load the index.html first then it kicks you to the index.php if your get my drft.
I have the file up there now.

http://www.rockinghamgateway.com/index.html

which should kick you to the index.php

TT
 
Old 08-17-2004, 10:20 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Not that I know of.. if your wanting it to load after a certain amount of time.. it has to come from the pages themself, not the server. Why do you want to do it from apache? It works now from clicking on it..

But if you have index.html and index.php as default index type pages.. its probably better to just leave it at .html and just have that page load the .php named as index2.php or something like that afterwards, so anyone that just types in the domain always sees the splash page..

To tell you the truth though, I design web sites and I hate splash type pages, they just seem to delay the site I'm trying to get to and also seems they've gone out of style a while back.. but that's just my opinion though.
 
Old 08-17-2004, 10:26 PM   #5
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Thanks

I'm not to worried about it, i could always have it as a link in code for other sites to link, if you get my drift.

I've always wanted our logo to show up first, because it took myself and a mate some time to create the logo.

TT
 
Old 08-17-2004, 11:12 PM   #6
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 14.0.4 - Server Ubuntu 14.04.5 LTS
Posts: 963

Original Poster
Rep: Reputation: 32
Hi mate i got it going, another mate showed me what to do

may help others as well

Just add

Code:
DirectoryIndex index.html index.php

to the <VirtualHost *:80> under the httpd file like so


Code:
<VirtualHost *:80>
    ServerAdmin webmaster@my_mail.com
    DocumentRoot /var/www/html/index.html
    DirectoryIndex index.html index.php
    ServerName my_site.com
</VirtualHost>
Thanks J for the code

TT
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Postifx and VirtualHost maginotjr Slackware 3 12-05-2005 09:28 AM
Apache -VirtualHost davidhk Debian 7 08-19-2005 12:33 PM
VirtualHost amdathlonboy Linux - Networking 2 06-22-2004 05:23 AM
Help with Apache <VirtualHost> please. smakkythecamel Linux - Networking 2 06-12-2003 07:15 PM
apache virtualhost jonfa Linux - Networking 5 08-12-2002 06:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration