redirect

I

Invader Zim

What html code do I use to redirect from one .htm page to another in say, 5
seconds(is it meta-refresh)?
 
W

Will Spencer

What html code do I use to redirect from one .htm page to another in say, 5
seconds(is it meta-refresh)?

Google prefers 301 Redirects to META Refresh.


Here is what the alt.internet.search-engines FAQ has to say:
(Source: http://www.internet-search-engines-faq.com/301-redirect.shtml)

How do I create a 301 Redirect?
-------------------------------


301 Redirects can be created in most web server software. The process to
create 301 redirects differs for each web server.



Configuring 301 Redirects in Apache
-----------------------------------

Configuring 301 Redirects in Apache is a two step process, configuring
httpd.conf and creating .htaccess.

Configuring httpd.conf to Enable a 301 Redirect
The first step is to edit your httpd.conf file to allow 301 Redirects.

This is done with Apache's Allow Override directive.

Find the line in your httpd.conf file which contains the AllowOverride
directive.

Edit this line by adding the "All" option to the end.

Example:

AllowOverride All

Save the file and restart Apache to make the configuration change take
effect.

Creating a .htaccess File to Configure a 301 Redirect

The next step is to actually create your .htaccess file.

The .htaccess file should be in the DocumentRoot directory for your web
site.

The .htaccess file contains two columns. The first column is what you want
redirected and the second column is where you want it redirected to.

For example, to redirect an entire web site to another site:

Redirect 301 / http://www.internet-search-engines-faq.com/

Or, to redirect just one page to another page:

Redirect 301 /old-page.shtml
http://www.internet-search-engines-faq.com/new-page.shtml


Other Redirects
---------------

There are redirects other than 301, although they are less frequently
utilized.

Redirect types are defined in RFC 2616: Hypertext Transfer Protocol --
HTTP/1.1.

Other redirect types include:

Numeric Code Name Meaning
301 Permanent The resource has permanently moved
302 Temp The resource has temporarily moved
303 Seeother The resource has been replaced



Configuring 301 Redirects in Microsoft Internet Information Server (IIS)
------------------------------------------------------------------------

Instructions for creating a 301 redirect in Microsoft IIS are available at
Microsoft Knowledge Base Article 313074 - HOW TO: Redirect Browser
Requests in Internet Information Services 5.0.

If you do not have Administrative access to the IIS server, you can still
create a 301 Redirect by following the instructions at ASP Tips - 301
Moved Permanently - Redirecting URLs with ASP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top