Forum Moderators: open

Message Too Old, No Replies

Little help needed with "redirect"

         

Malice

4:38 am on Oct 25, 2004 (gmt 0)

10+ Year Member



I am trying to "redirect" people from the main URL of my domain to the page within where my site is actually located. My husband created the domain a long time ago and I have been running my business from a subpage, well he doesnt use the site at all and I just want to direct people who use the main url to my page... frankly i'm tired of signing my work with the full url to my page. My husband claims this can be done with like 3 lines of html but says I have to figure it out on my own :(

I only know basic html, enuff to create my site with an editor, so any explanation would be greatly appreciated.

Thanx in advance!
~Malice

cabeze

4:52 am on Oct 25, 2004 (gmt 0)

10+ Year Member



This should work.

Just create an index.html file and place it in your root folder, www.mysite.com/index.html

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="REFRESH" content="0; URL=https://www.mysite.com/whereeveryouwanttogo/yourpage.html">
</head>
<body>

this should redirect them to your page.

BonRouge

4:58 am on Oct 25, 2004 (gmt 0)

10+ Year Member



Go to the main index page of your domain - (probably called 'index.htm' or 'index.html')
and put this :
onload=javascript:window.location="http://example.com"
in the body tag i.e.
<body onload=javascript:window.location="http://example.com">
(Of course, you might like to replace the URL with the index of your own site rather than mine.)

EDIT : Actually, yeah - the idea above is probably better than mine (some people don't have javascript).

[edited by: BlobFisk at 12:12 pm (utc) on Oct. 25, 2004]
[edit reason] No URLs please! See TOS [webmasterworld.com] [/edit]

grandpa

5:04 am on Oct 25, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi Malice. Welcome to WebmasterWorld. <add>You too, cabeze</add>

Hmmm, I type pretty slow. Besides whats been offered, the best way to accomplish this is to modify your .htaccess file and add a 301 redirect. This will tell the search engines to permanently refer to your site address for this domain.

Here's an example:
RewriteRule index\.html$ http://www.domain.com/your_page.html [R=301,L]

<add>
If you want to read more about this option, here are a few places to get started:
Apache Web Server Charter [webmasterworld.com]
(Bummer - the library is empty...)
Apache Web Server Forum [webmasterworld.com]

[edited by: grandpa at 5:25 am (utc) on Oct. 25, 2004]

BonRouge

5:15 am on Oct 25, 2004 (gmt 0)

10+ Year Member



Even better!

cabeze

5:20 am on Oct 25, 2004 (gmt 0)

10+ Year Member



Thanks grandpa.

I just figured out the rewrite thingy yesterday for my site. Loads of fun.

Malice

7:06 am on Oct 25, 2004 (gmt 0)

10+ Year Member



Awesome! Thank you guys much for the help, I really appreciate it. And thanx for the welcome too :)

~Malice