출처 : http://free4u.wo.tc/weblog/951
apache웹서버 운영시 이전url로 접근시(현재 존재하지 않는 파일 혹은 링크) REDIRECT를 이용하면 접속자에게 불편함을 주지 않고 새url로 이동시킬수있습니다.
http://free4u.wo.tc/i4u.htm 은 현재 이서버에 존재하지 않지만 http://free4u.wo.tc/ 로 redirect시켜서 이전에
즐겨찾기로 접근한 사람들은 불편없이 사이트를 이용할수있습니다.
뭐 별거 아닌데 글만 길게썼군요^^;
httpd.conf에
Redirect 이전url 새로운url형식으로 넣으면 됩니다.
ex:) Redirect /i4u.htm http://free4u.wo.tc
아래는 http://apache.org 에 있는 문서내용입니다.
Redirect directive
Syntax: Redirect [status] URL-path URL
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: The directory and .htaccess context's are only available in versions 1.1 and later. The status argument is only available in Apache 1.2 or later.
The Redirect directive maps an old URL into a new one. The new URL is returned to the client which attempts to fetch it again with the new address. URL-path a (%-decoded) path; any requests for documents beginning with this path will be returned a redirect error to a new (%-encoded) URL beginning with URL.
Example:
Redirect /service http://foo2.bar.com/service
If the client requests http://myserver/service/foo.txt, it will be told to access http://foo2.bar.com/service/foo.txt instead.
Note: Redirect directives take precedence over Alias and ScriptAlias directives, irrespective of their ordering in the configuration file. Also, URL-path must be an absolute path, not a relative path, even when used with .htaccess files or inside of <Directory> sections.
If no status argument is given, the redirect will be "temporary" (HTTP status 302). This indicates to the client that the resource has moved temporarily. The status argument can be used to return other HTTP status codes:
permanent
Returns a permanent redirect status (301) indicating that the resource has moved permanently.
temp
Returns a temporary redirect status (302). This is the default.
seeother
Returns a "See Other" status (303) indicating that the resource has been replaced.
gone
Returns a "Gone" status (410) indicating that the resource has been permanently removed. When this status is used the url argument should be omitted.
Other status codes can be returned by giving the numeric status code as the value of status. If the status is between 300 and 399, the url argument must be present, otherwise it must be omitted. Note that the status must be known to the Apache code (see the function send_error_response in http_protocol.c).
관련 링크: http://httpd.apache.org/docs/mod/mod_alias.html#redirect
'WEB > Apache' 카테고리의 다른 글
아파치 동시접속자수 변경 (1.3.xx 및 2.0.xx 버전) (0) | 2010.02.02 |
---|---|
아파치 웹서버 보안설정 2 (0) | 2010.01.22 |
아파치 웹서버 보안 설정 (0) | 2010.01.22 |
아파치 80포트로 서비스 올릴때 에러발생 : Permission denied: make_sock: could not bind to address [::]:80 (0) | 2010.01.21 |
Apache rewrite 사용 방법 - 특정 URL이 입력되면 다른 URL로 연결 (0) | 2010.01.21 |