Acrobat PDF

mod-rewrite cheat sheet - business document, template guide

You must be logged in to download this document
Description

mod-rewrite cheat sheet - business document, template guide

Reviews
Shared by: Alisha Wright
Stats
views:
786
rating:
not rated
reviews:
0
posted:
1/1/2008
language:
English
pages:
0
mod_rewrite Server Variables ^ $ . (a|b) (...) [abc] [^abc] a? a* a+ a{3} a{3,} a{3,6} !(pattern) R[=code] F G P L N C Format %{NAME_OF_VAR} HTTP Headers HTTP_USER_AGENT HTTP_REFERER HTTP_COOKIE HTTP_FORWARDED HTTP_HOST HTTP_PROXY_CONNECTION HTTP_ACCEPT Request REMOTE_ADDR REMOTE_HOST REMOTE_USER REMOTE_IDENT REQUEST_METHOD SCRIPT_FILENAME PATH_INFO QUERY_STRING AUTH_TYPE Server DOCUMENT_ROOT SERVER_ADMIN SERVER_NAME SERVER_ADDR SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE Time TIME_YEAR TIME_MON TIME_DAY TIME_HOUR TIME_MIN TIME_SEC TIME_WDAY TIME Special API_VERSION THE_REQUEST REQUEST_URI REQUEST_FILENAME IS_SUBREQ Start of string End of string Any single character a or b Group section Item in range (a or b or c) Not in range (not a or b or c) Zero or one of a Zero or more of a One or more of a Exactly 3 of a 3 or more of a Between 3 and 6 of a "Not" prefix. Apply rule when URL does not match pattern. Redirect to new URL, with optional code (see below). Forbidden (sends 403 header) Gone (no longer exists) Proxy Last Rule Next (i.e. restart rules) Chain T=mime-type Set Mime Type NS Skip if internal sub-request NC QSA NE PT S=x E=var:value Case insensitive Append query string Do not escape output Pass through Skip next x rules Set environmental variable "var" to "value". 301 302 403 404 410 Moved permanently Moved temporarily Forbidden Not Found Gone NC OR Case insensitive Allows a rule to apply if one of a series of conditions are true. # Site has permanently moved to new domain # domain.com RewriteCond RewriteRule to domain2.com ^www.domain.com$ [NC] [R=301,L] http://www.domain2.com/$1 %{HTTP_HOST} ^(.*)$ # Page has moved temporarily # domain.com/page.htm RewriteRule ^page.htm$ to domain.com/new_page.htm [R,NC,L] new_page.htm # Nice looking URLs (no querystring) # domain.com/category-name-1/ RewriteRule ^([A-Za-z0-9-]+)/?$ to domain.com/categories.php?name=category-name-1 [L] categories.php?name=$1 # Nice looking URLs (no querystring) with pagination # domain.com/articles/title/5/ RewriteRule to domain.com/article.php?name=title&page=5 article.php?name=$1&page=$2 [L] ^articles/([A-Za-z0-9-]+)/([0-9]+)/?$ # Block referrer spam RewriteCond RewriteCond RewriteRule %{HTTP_REFERER} %{HTTP_REFERER} .* [F] (weight) (drugs) [NC,OR] [NC] Directives RewriteEngine RewriteOptions RewriteLog RewriteLogLevel RewriteLock RewriteMap RewriteBase RewriteCond RewriteRule Available free from www.ILoveJackDaniels.com

Shared by: Alisha Wright
About
Social Media Entrepreneur and Strategist.
Other docs by Alisha Wright
Related docs
mod_rewrite Cheat Sheet
Views: 0  |  Downloads: 0
mod_rewrite
Views: 1  |  Downloads: 0
Mihai's SEO Cheat Sheet
Views: 133  |  Downloads: 26
Mihai Gheza SEO Cheat Sheet
Views: 0  |  Downloads: 0
Cheat Sheet Suchmaschinenoptimierung
Views: 10  |  Downloads: 0
Cheat Sheet SEO for Wordpress
Views: 226  |  Downloads: 88
The Web Developers SEO Cheat Sheet
Views: 53  |  Downloads: 16
NTTVERIO Standard User Guide Template
Views: 1  |  Downloads: 0
The Web Developer's SEO Cheat Sheet
Views: 0  |  Downloads: 0