mod-rewrite cheat sheet - business document, template guide

Description

mod-rewrite cheat sheet - business document, template guide

Reviews
Shared by: Alisha Wright
Stats
views:
852
rating:
not rated
reviews:
0
posted:
1/1/2008
language:
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
15th Annual Critics Choice Movie Awards
Views: 29  |  Downloads: 0
Google Book Settlement Supplemental Notice
Views: 21  |  Downloads: 0
What Matters Now
Views: 269  |  Downloads: 7
First Look at Microsoft Office 2010 Free ebook
Views: 155  |  Downloads: 10
Adding Value to Your Business in 2010
Views: 34  |  Downloads: 2
AVERY Wizard Guide 2009
Views: 45  |  Downloads: 0
Uncover New Online Sales Opportunities
Views: 15  |  Downloads: 0
State of US Online Retail Economy in Q3 09
Views: 27  |  Downloads: 0
Topsy Search Engine
Views: 16  |  Downloads: 0
Official UPS Twitter Directory 2009
Views: 15  |  Downloads: 0
Google Launches New Web Toolkit
Views: 28  |  Downloads: 0
State Fiscal Stabilization Fund
Views: 21  |  Downloads: 0
Related docs
mod_rewrite Cheat Sheet
Views: 0  |  Downloads: 0
NTTVERIO Standard User Guide Template
Views: 1  |  Downloads: 0
mod_rewrite
Views: 6  |  Downloads: 0
RGB Hex Cheat Sheet
Views: 14  |  Downloads: 1
Mihai's SEO Cheat Sheet
Views: 137  |  Downloads: 27
Inter-departmental Redirection Advice
Views: 1  |  Downloads: 0
Cheat Sheet Suchmaschinenoptimierung
Views: 10  |  Downloads: 0
Cheat Sheet SEO for Wordpress
Views: 233  |  Downloads: 91
The Web Developers SEO Cheat Sheet
Views: 47  |  Downloads: 12