Electric Type

Multimedia

About Us

News

Help

Redirect or Symbolic Link?

Page 2 — Redirects

What happens during a server-side redirect? When the server receives a URL that's been redirected, it sends an error code (301 to be exact), along with the new location, to the client, which then resends back a request for the new URL. The computer user shouldn't notice anything unusual until the page is served with an address different from the one she typed in.

In order for this to happen, though, you must first tell the server what to do. The process varies depending on what type of server you are using and how it's configured, but essentially you'll just be providing the server with a redirect command, the old path, and the new path. If you're using an ISP to host your pages, you can probably place this information in your home directory in a file named .htaccess, but you should check with them first. Using Unix, it would look something like this:

    Redirect pathname url

In this example, pathname is the old location, and url is the new.

If your ISP doesn't allow this or you're running your own server, you can put the information in one of the server's configuration files. Apache and NCSA servers keep this information in the Resource Configuration (srm.conf) file. CERN servers only have one configuration file, which can contain an unlimited number of directives.

The redirect directive is part of a series of translation rules used by the server to determine how a request should be handled. The format for the CERN redirect function is:

    Redirect expression url

This works pretty much the same way as the example above. Thus, expression is the old location, and url is the new one.

One thing to remember about CERN's translation rules is that they are applied in order, so for example, if you place a command to disallow access to a file and then place the redirect command, the request would already be denied by the time the server got to the redirect command.

If you are using WebSite for your server, you can create a redirect from the Server Properties window in the Mapping area. Just select Redirect and type in the old path and the new path. It's also possible to set up a redirect from WebStar for the Macintosh or Windows via a plug-in from NetDreams that will create a RAW file in the main directory.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.