Help - Search - Members - Calendar
Full Version: Site Starting Page.
Zymic Webmaster Forums > Web Design & Development > General Web Design Discussion
Pixeltor
When I create a site there is a default page called "index" created, and when i enter my website address into my browser it automatically goes to "index", how do I set it to go to a different page on visitation?


thanks - Pixeltor
Jetteh22
Umm, I'm not even sure if that's possible because I can't figure out any reason why anybody would want it going to a different page other than the index page - that's bound to create confusion.

If you -really- don't want it going to index, use a redirect script..

Go into the default index page and clear it out, leaving only the needed tags (html, head, title, body, and closing tags).. Then add this:
CODE
<script type="text/javascript">
<!--
window.location = "URL YOU WANT IT TO GO TO GOES HERE"
//-->
</script>





Pixeltor
Yeah, I have my whole website built on my pc, and I named my homepage Home.html so all the links are linked to that page, thanks though the script worked. smile.gif
MrTouz
I dunno if the script will work if people have Javascript Disabled. I never tested it, never tried it.. never knew... but just because i dunno i don't use JS for redirection but META tags

CODE
<META http-equiv="refresh" content="2; URL=http://www.ASpamSite.com/">


content = is the time in seconds
url = is the link to your new page aka http://www.mysite.com/homE.html
Pixeltor
what are the pros and cons of using a META tag instead?
Jetteh22
Use the meta tag one. Thanks alot MrTouz - I forgot all about that one!

The pros are that even if someone has javascript disabled in their browser they will still redirect.
You can clear the # out and just put content="URL=http://ASpamSite.com" instead, it will automatically redirect, instead of using seconds.
MrTouz
i usually set it to 0, tho i never use it tongue.gif i love my index.html tongue.gif
Luke
Just to add to the discussion, if you have access to change your httpd.conf file than you can add any filename you want under DirectoryIndex to make a new index page.

CODE
DirectoryIndex index.html index.txt default.php start.htm


but stick with the meta tag, it works fine for what you need. wink.gif
Pixeltor
thanks, the meta tag works great, Some day I think i'll rename 'er to index and painfully search through the html for any links to "Home.html". but for the meanwhile it certainly does the job.

thanks!
Luke
I think that'd be smarter to replace the home.html with index... many text editors have find and replace functions that you can search through many files at the same time... find "home.html" and replace "index.html". If you find time I'd just do that! wink.gif
Pixeltor
yeah, those are quite usefull. anyways instead of adding more data to some server in the world, I'll post my question in here. (completely off topic)

so I got my site up and running, It looks great on IE7, I showed my cousin the site since we are sort of sharing it and...... It looks like crap on firefox, safari, opera, and pretty much whatever else, basically it only looks good on IE.
so I open my css file, and start with something easy(i thought) the horizontal rule:

hr
{
color: orange;
}

why wont this make a orange hr in firefox?, i looked it up and it should be compatible with firefox.

help greatly appreciated
Luke
First off, you can put a link here so we can see it.

When styling horizontal rules you should use the color and background color properties. It's different for ie, mozilla, and opera. the color property works for ie and background color works for opera and mozilla.

CODE
hr {
background: orange;
color: orange;
}
Pixeltor
hr
{
background-color: orange;
color: orange;
}

wont work. Is it perhaps something more external?, I really havent got a clue, it seems so simple sad.gif
Jetteh22
Did you try simply:

<hr color="orange">

Works in IE.. Dunno about FF or any of the others, or if it's even considered valid code anymore, but that's what I've always used if I didn't use images (which is another, alternate choice)
Luke
jetteh, i think that's deprecated. not sure but it's always a better idea to use css for all styling.

pixeltor, put the site up so we can see the problem or at least the code.
Jetteh22
Another alternative way to do it is as follows.
It requires more coding, but.. If you can't get the HR to work for some odd reason, this should work also.

Your stylesheet:
CODE
hrule {
height: 0px;
width: 100%; // or however wide you want it
border-bottom: 2px solid orange;
}


Where you want your HR to appear, instead of <hr> do:
CODE
<div class="hrule"></div>
Luke
That would work... but there shouldn't be problems with that code. It's either on your side (your browser) or some of your other code is somehow messing with it.
Pixeltor
Sorry, I was busy last night wacko.gif

http://pixeleum.uuuq.com/Home.html

by the way, it works in IE fine and always has, its mozzilla that wont work.

Jetteh22:

<hr color="orange">

that worked in them both, but I would rather not go through all my html changing it all. afterall a .css is supposed to help simplify things, and on most sites it says mozilla should support the css hr class.
Luke
Gettin an error on that page.

I tested the hr in css and worked on my end in firefox, opera, and safari and it worked.... what version browsers are you using?
Pixeltor
woh, I get an error too, I can not connect using ftp either.

I'm using IE7 and FF2.0.0.20
Luke
What code are you using? The proper way to use it is <hr /> for valid xhtml. Just a simple mistake such as forgetting the space <hr/> will screw it up.
Pixeltor
tried <hr>, <hr/>, <hr />

none seem to do any different.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.