Documente Academic
Documente Profesional
Documente Cultură
1 xx 2 xx 3 xx 4 xx 5 xx
Informational Success Redirection Client error Server error
1 2
Topics
1 xx
Informational
f l Server is
i performing
f i
some further action
and does not yet have a
4 xx
definitive response
Client error
Error was found from
client side
2 xx
Success
The action requested by
the client was
5 xx
successful received
Server error
The server failed to
fulfill a valid request
3 xx
Redirection
Site will be redirected
or URL forwarding
Topics
100 Allow a client that is sending a request message to determine if server is willing to accept the
continue request.
101
Server will switch protocols to those defined by the response's Upgrade header field immediately
Switching
after the empty line which terminates the 101 response.
Protocols
Topics
201
New resource being created.
created
202
The request has been accepted for processing.
accepted
203
non- The returned metainformation in the entity-header is not the definitive set as available from the
authoritative origin server.
information
204 The server has fulfilled the request but does not need to return an entity-body, and might want to
no content return updated metainformation.
205 The server has fulfilled the request and the user agent should reset the document view which
reset content caused the request to be sent.
206
The server has fulfilled the partial GET request for the resource.
partial content
Topics
300
The requested resource correspond to multiple specific location.
Multiple Choices
301
Moved The requested resource has been assigned to new permanent URI.
Permanently
302 The requested resource resides temporarily under a different URI. This response is only cacheable
Found if indicated by a Cache-Control or Expires header field.
303 The response to the request can be found under a different URI and SHOULD be retrieved using a
S Oth
See Other GET method
th d on that
th t resource.
304 If the client has performed a conditional GET request and access is allowed, but the document has
Not Modified not been modified.
305
The requested resource must be accessed through the proxy given by the location field.
Use Proxy
1 2
306 The 306 status code was used in a previous version of the specification, is no longer used, and the
(Unused) code is reserved.
307 If the 307 status code is received in response to a request other than GET or HEAD, the user agent
Temporary must not automatically redirect the request unless it can be confirmed by the user, since this might
Redirect change the conditions under which the request was issued.
Topics
400
The requested cannot be fulfilled due to bad syntax.
Bad Request
401
It will happen when authentication has failed.
Unauthorized
402
Payment Reserve for future use for digital cash or micro payment.
Required
4 3
403
Th request
The q t was a legal
l l request,
q t butb t the
th server is
i refusing
f i to t respond
d tto it
it.
Forbidden
404
The requested resource could not be found but may be available again in the future.
Not Found
405
A request was made of a resource using a request method not supported by that resource. For example,
Method Not
using GET on a form which requires data to be presented via POST.
Allowed
1 2
406 The requested resource is only capable of generating content not acceptable according to the
Not Acceptable Accept headers sent in the request.
407
Proxy
It need proxy authentication for accessing the site.
Authentication
Required
408
The server timed out waiting for the request.
Request Timeout
4 9
409
Indicates that the request could not be processed because of conflict in the request.
request
Conflict
410
Indicates that the resource requested is no longer available and will not be available again.
Gone
411
The request did not specify the length of its content.
Length Required
412
Precondition The server does not meet one of the preconditions that the requester put on the request.
Failed
413
Request Entity The request is larger than the server is willing or able to process.
Too Large
1 2
414
Request-URI The URI provided was too long for the server to process.
Too Long
415
Unsupported The request entity has a media type which the server or resource does not support.
Media Type
416
Requested Range The client has asked for a portion of the file, but the server cannot supply that portion.
Not Satisfiable
417
E
Expectation
t ti Th server cannott meett the
The th requirements
i t off the
th EExpectt request-header
t h d fi field.
ld
Failed
418
This request is not expected to be implemented by actual HTTP servers.
p
I'm a teapot
Topics
500
Internal Server A generic error message, given when no more specific message is suitable.
Error
501
Not The server either does not recognize the request method, or it lacks the ability to fulfill the request.
Implemented
502 The server was acting as a gateway or proxy and received an invalid response from the upstream
Bad Gateway server.
503
S i
Service Th server is
The i currently
tl unavailable
il bl (because
(b it is
i overloaded
l d d or d
down ffor maintenance).
i t )
Unavailable
504
The server was acting as a gateway or proxy and did not receive a timely response from the
Gateway
upstream server.
Timeout
505
HTTP Version The server does not support the HTTP protocol version used in the request.
Not Supported
1 2
506
Variant Also Transparent content negotiation for the request results in a circular reference.
Negotiates
507
Insufficient Disk is running out of space.
Storage
509
Bandwidth Limit This status code, while used by many servers, is not specified in any RFCs.
Exceeded
510
Further extensions to the request are required for the server to fulfill it.
Not Extended
Topics
1. Security
Hide underlying
y g technology gy – index.php
p p
Hide actual path of files – http://www.xxx.com/images/simple?photo=34
Rewrite Engine On
Topics
Metacharacter
Char Definition
\ Use before any of the following characters to escape or null the meaning or it.
it \\* \.
\ \$ \+ \[ \]
. Any character.
[] Starts a class.
| Starts
Sta ts a
alternative
te at ve match
atc tthis|that
s|t at wou
would
d mean
ea match
atc tthiss o
or tthat.
at.
Char Definition
File-system path
URL path
could be used
as a target.
Absolute URL
Char Definition
[R] Redirect
d you can add
dd an =301 or =302 to change
h the
h type.
[L] Last rule. (You should use this on all your rules that don't link together)
[N] Next round. Rerun the rules again from the start.
[NE] Turns of normal escapes that are default in the rewrite rule.
[S] Skip the next rule S=3 skips the next 3 rules.
M h this
Match h URL “h
“http://xxx.com”
//
RewriteEngine On
Pattern inside parentheses is Replace with this URL Redirect with 301 and
capture as variable “$1” make this as the last
Rewrite rule.
Topics
M h this
Match h URL “h
“http://xxx.com”
//
RewriteEngine On
Pattern inside parentheses is Replace with this URL Redirect with 301,
301
capture as variable “$1” but it is query append string
not used for this case and make this as the
last rewrite rule.
Topics
RewriteEngine On
M h “/bl
Match “/blog/”
/” pattern R l
Replace with
i h this
hi URL Rules
R l are served d
through proxy, case
insensitive and make
this as the last Rewrite
rule.
References
http://www.webforgers.net/mod-rewrite/mod-rewrite-syntax.php
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html
http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
http://en.wikipedia.org/wiki/URL_redirection#Manual_redirect
Thank yyou for watching
g
my presentation
Created by
panu ausavasereelert
blog: http://panu.in.th
email: panu@panu
panu@panu.in.th
in th
twitter: @panuinth