AdditionalResourcesThisappendixpointsouttherathershortlistofonlineandotherresourcesavailableforfurtherassistancewithmod_rewrite.
OnlineResourcesOnlineresourcesformod_rewritearerathersparse,andmanyoftheonlineresourcescontaininformationthatisincorrectoroutdated.
Thefollowinglistingpresentsafewofthebetterwebsiteswhereyoucanfindinformationonmod_rewrite:mod_rewriteCookbook(http://rewrite.
drbacchus.
com/):Initiallystartedasascratchpadforthebookyouarenowholding,thissiteisacollectionofpracticalsolutionstocommonproblems.
Itcontainsmanyoftherecipesinthisbook,aswellasthoseintheRewriteGuideintheonlinedocumentation.
Apachemod_rewrite(http://httpd.
apache.
org/docs/2.
1/rewrite/):Thedocu-mentationformod_rewritehastraditionallybeenalittleintimidating.
Thisisunderstandable,giventhecomplexityandpowerofthemodule.
Butthereisaneffortunderway,atthetimeofthiswriting,torefurbishthedocumentationandmakeitfriendliertothebeginner.
Apachemod_rewriteURLRewritingEngine(http://httpd.
apache.
org/docs/mod/mod_rewrite.
html):Theofficialmod_rewritedocumentationistheplacetogoforauthoritativeinformationaboutthemoduleanditsconfigurationoptions.
BooksMasteringRegularExpressions,SecondEditionbyJeffreyFriedl(O'Reilly,2002),oftenreferredtoasjustMRE,isthedefinitiveworkonregularexpressions.
RegularExpressionRecipes:AProblem-SolutionApproachbyNathanA.
Good(Apress,2005)presentsacompendiumof100regularexpressionsolutionsforPHP,Perl,Python,grep,sed,andVim.
133APPENDIXPCREDocumentationPCREstandsforPerlCompatibleRegularExpressions.
TounderstandPCRE,youshouldturntoPerl.
AtthecommandlineonanymachinewithPerlinstalled,typeperldocperlreforthePerlregularexpressiondocumentation.
Orreaditonlineathttp://perldoc.
perl.
org/perlre.
html.
APPENDIXADDITIONALRESOURCES134NumbersandSymbols|(alternation)syntax,functionof,17–18*(asterisk)characterformatchingzeroormorecharacters,10–11inregularexpressions,8\(backslash)characterasescapecharacter,9inregularexpressions,8[](brackets)formatchingoneofagroupofcharacters,13inregularexpressions,8^(caret)characterdenoting"thestringstartswith",37inregularexpressions,8\d{3}metacharacter,representationforphonenumbers,16-(dash),replacingwith_(underscore)inaURI,42$(dollarsign)characterdenoting"thestringendswith",37inregularexpressions,8!
(exclamation)characterfornegatinganentireregularexpressionmatch,13–14inregularexpressions,8\(metacharacter,representationofanoptionalopeningparenthesis,15()(parentheses)forgroupingandcapturingseveralcharactersasaunit,11–12inregularexpressions,8%(percentagesign),usingwithRewriteCond,12.
(period)characterforpatternmatchinginregularexpressions,9inregularexpressions,8+(plussign)characterformatchingoneormorecharacters,10inregularexpressions,8#(poundsign)forcommentingoutlinesinconfigurationfiles,26resultsofusinginarewritetarget,42–43(questionmark)characterformakingasinglecharactermatchoptional,11inregularexpressions,8""(twoquotationmarks),usingforcomparisontests,54_(underscore),replacing-(dash)withinaURI,42Aaccesscontrolwithmod_rewrite,91–94simpleclient-based,94–97usingmod_rewritetosolveproblemswith,89–97usingtheallowanddenydirectivesforaddress-based,89–90AddModuledirectives,inconfigurationfiles,26–27address-basedaccesscontrol,usingtheallowanddenydirectivesfor,89–90Alias,using[PT]withtomapaURItoadirectory,44Aliasdirectives,resolvingissuesofallquittingworking,106–107AllowOverridedirective,settingtopermituseofmod_rewritedirectives,29anchorcharacters,9–10Apache,third-partydistributionsof,21–22Apache1.
3installingmod_rewriteasasharedobjecton,24–25limitingproxyserveraccessin,115Apache2.
xinstallingmod_rewriteasasharedobjecton,25limitingproxyserveraccessin,115Apachemod_rewrite.
Seealsomod_rewritewebsiteaddressfordocumentationfor,133Apachemod_rewriteURLRewritingEngine,web-siteaddressfordocumentationfor,133Apachemodules,enablingordisablinginstalled,26Apachewebserver,installationdocumentation,22applicationserver,proxyingto,118apxsutility,foraddingmod_rewriteasasharedobjectwithoutrecompilingApache,24–25asterisk(*)character.
See*(asterisk)characterBbackreferences,containedinarewritetarget,36backslash(\)character.
See\(backslash)characterbinaryinstallation,ofmod_rewrite,25–27brackets([]).
See[](brackets)C[C]or[chain]flag,forRewriteRule,37–38canonicalhostname,codeexampleforrequiringtoreachourwebsite,75–76caret(^)character.
See^(caret)character[chain]or[C]flag,forRewriteRule,37–38Index135characters,using[](brackets)formatchingoneofagroupof,13cleanURLscreatingwithmod_rewrite,2exampleof,41clientvariables,forRewriteConddirective,48–49client-basedaccesscontrol,withmod_rewrite,94–97[CO]or[cookie]flag,forRewriteRule,38–39codeexampleaddingmapfileconfigurationlinestotheconfigurationfile,109foraddingvirtualhoststoyourApacheconfigurationfile,100alternativetousingmod_rewritetoblockaspiderfromhammeringyourwebsite,95forcausingApachetosendanHTTP410Gonestatuscode,40forchanginguppercaseormixedcasefilenamestolowercase,67forcomparisontestsusingRewriteConddirective,54ofconfigurationfileforrandomizedrewrites,63–64forconfiguringvirtualhosts,102forcreatingaRewriteMapthatmapshostnamestodirectorypaths,108forcreatingper-lettersubdirectorieswithmod_rewrite,106forcreatingtxtmapfiles,61fordenyingaccesstousersnotusingFirefox,90forenablingmod_rewritebinaryinstallation,26–27forenablingtheRewriteLog,29,123forexcludingcontentfromtheproxy,119forexpressinganemailaddressasaregularexpression,14–15forforcingtargetURLtobehandledwithaspecificcontent-handler,41forforcinguserstocomethroughthefrontdoor,85–86forfurthersubdivisionsforvirtualhosts,103forgivingdifferentcontententirelytointernalandexternalviewers,84forgroupingandcapturingseveralcharactersasaunit,11–12forinstallingmod_rewriteasasharedobjectonApache1.
3,24–25forinstallingmod_rewriteasasharedobjectonApache2.
x,25forinstallingmod_rewriteasastaticallycompiledmodule,23invokinghttxt2dbmutilitywithnoarguments,65forlimitingaccesstoproxyserverinApache1.
3,115forlimitingaccesstoproxyserverinApache2.
x,115forloggingtoasinglelogfileandthensplittingthelogfilelater,110forlookinginmorethanoneplaceforafile,74formakingamatchoptional,11formakingclientcertificatevalidationerrormessagesmoreunderstandable,87formatchingadirectory,18formatchingafiletype,18formatchinganycharacter,9formatchingaphonenumber,15–16formatchingoneofagroupofcharacters,13formatchingoneormorecharacters,10formatchingthehomepage,17–18formatchingzeroormorecharacters,10–11innonproxyenvironmenttolookinseveralplacesforrequestedfile,120foronedirectoryperletterforvirtualhosts,103Perlscriptforreplacing-(dashes)with_(underscores),66–67forplacingRewriteConddirectivesbeforetheRewriteRules,107–108forpointingRewriteMapdirectiveatnewlycreateddatabase,65forpreventingimagetheftfromyourwebsite,53,96–97forpreventinguploadingofPHPfileandthenexecutingthem,86forprotectingagainstgettingtothecontestpageoutsideofdatesrange,82forproxyinganentirevirtualhosttoanotherserver,116forproxyingaparticularfiletypetoaback-endimageserver,117forproxyingasingledirectorytoanotherserver,116forproxyingofthe/images/directoryonafront-endserver,117forproxyingrequeststooldserverifcontentisnotonnewserver,120forredirectingto/maintenance.
htmlunlessyou'realreadythere,80forredirectingusersbasedontheirbrowsertype,83forreplacing-(dash)with_(underscore)inaURI,42forrequiringacanonicalhostnametoreachourwebsite,75resolvingissuesofCGIandscriptsservedasplaintext,107–108forrewriteblockinan.
htaccessfileindocumentrootdirectory,80forRewriteRuledirectivesyntax,32forrewritingfailingrequeststoanotherserver,75forrewritingpathinformationtoaquerystring,69–73ofrulesetforasimplerewritetoafilepath,105forsendingexternaluserselsewhere,84forservingdifferentcontentbasedonuser'susername,85ofasimpleRewriteLogexample,124INDEX136solutionforensuringaccesstoasiteisavailableviaSSL,77solutiontoviewingthewrongSSLhost,76forsplittingalogfileintoitscomponentparts,110switchingfromColdFusiontoPHPandmakingoldURLswork,73fortellingusersacontestisover,83fortestingwhethermod_rewriteiscorrectlyinstalled,27using[cookie]or[CO]flag,39using[env]or[E]flag,39using[OR]orornextflagwithRewriteConddirective,56using[QSA]flag,44using[R]flagwithRewriteRuledirective,45usingfordenyingaccesstoURIs,90usinganchorcharacters,9–10usingdate-andtime-basedrewrites,82usingenvironmentvariablesandmod_rewritetoblockaspider,95forusingenvironmentvariablewithRewriteConddirective,53usingForbiddenor[F]flag,40forusingfront-endserverasloadbalancer,63forusingHTTPMIMErequestheaderwithRewriteConddirective,53usingIncludeconfigurationdirective,100usingmod_rewritefordenyingaccesstoaparticulardirectory,92usingmod_rewritefordenyingaccesstoseveraldirectoriesatonce,93usingmod_rewriteforproxyingeverythingconfiguration,117usingmod_rewritetoblockaspiderfromhammeringourwebsite,94usingnegation,14usingNoEscapeor[NE]flaginarewritetarget,43usingPassthruor[PT]flag,44usingProxyor[P]flag,43usingProxyPassdirective,113usingRedirectdirective,4–5usingRedirectMatchdirective,5,36usingRewriteConddirectivetopreventlooping,56usingRewriteCondinRewriteLogexample,127–128usingRewriteCondsyntax,47–48usingRewriteCondtestflagstocheckifafileisonanoldserver,55usingRewriteCondtopreventarulefromlooping,47usingRewriteCondtoresolveproblemsassociatedwithhostnames,105usingRewriteMapdirective,59usingRewriteMapwithaprg:maptypeformorethanninearguments,72usingRewriteRuleflags,37usingrewritetarget,36forusingSSLenvironmentvariablewithRewriteConddirective,53usingthe[S]orSkipflag,46usingthe[T]orTypeflag,46usingtheallowanddenydirectivesforaddress-basedaccesscontrol,89–90usingtheNoCaseor[NC]flag,42usingtheRewriteBasedirective,33usingtime-basedredirection,50comparisonoperators,tocompareateststringwithsomeothervalue,54competitionwebsite,showingonlyduringacompetition,81–83conditionalchanges,withmod_rewrite,3conditionalrewrites,examplesforcommontasksandafewnot-so-commontasks,79–87configurationfilescommentingoutlinesin,26importanceofrestartingApacheaftermakingchangesto,36mainserver,32–33configuringandinstallingmod_rewrite,21–30cookieflag,forsettingasapartofarewritingtransaction,38–39[cookie]or[CO]flag,forRewriteRule,38–39D-dtestflag,usingtoseeiftheTestStringexistsasafilepathandisadirectory,54date-andtime-basedrewrites,81–83date/timevariables,forRewriteConddirective,50dbm:maptype,creatingwithRewriteMapdirective,64–65dbmrewritemaprewritefunction,usableinRewriteRule,65debuggingwithRebug,131–132yourrewriterulesandregularexpressions,123–132blocksand.
htaccessfiles,generalrulefor,91directorymatching,18documentation,forinstallingApachewebserver,22dollarsign($)character.
See$(dollarsign)characterE[E]or[env]flag,forsettingthevalueforanyenvironmentvariable,39–40emailaddress,regexexamplefor,14–15Engelschall,Ralf,mod_rewritewrittenby,6[env]or[E]flag,forsettingthevalueforanyenvironmentvariable,39–40environmentvariable,flagforsettingforany,39–40INDEX137Finditfasterathttp://superindex.
apress.
com/environmentvariable-basedaccesscontrol,fordenyingaccesstousersnotusingFirefox,90errormessagesexampleshowingmod_rewriteisnotinstalled,29exampleshowingmod_rewritenotproperlyinstalled,28solutionwhenclientcertificatevalidationisindecipherable,87escapecharacter,\(backslash)characteras,9exclamation(!
)character.
See!
(exclamation)characterF-ftestflag,usingtoseeiftheTestStringexistsasafilepathandisafile,54-Ftestflag,usingtoseeiftheTestStringisavalidfileandisaccessible,54favicon.
icofiles,websiteaddressforinformationaboutandhowtocreatethem,126filetype,matching,18flags.
SeeRewriteRuleflagsForbiddenor[F]flag,forforcinganHTTP403Forbiddenstatuscode,40forwardproxyingfunctionof,114–115usingProxyRequestsdirectivetoforbid,114–115Friedl,Jeffrey(O'Reilly,2002),MasteringRegularExpressions,SecondEditionby,7,133FTPaddresses,codeforproxying,113G[G]orGoneflag,forcausingApachetosendanHTTP410Gonestatuscode,41GNUTalkFilters,websiteaddressforobtaining,119Goneor[G]flag,forcausingApachetosendanHTTP410Gonestatuscode,40Good,NathanA.
(Apress,2005),RegularExpressionRecipes:AProblem-SolutionApproachby,133greedymatching,inregularexpressions,11H[H]orHandlerflag,forforcingtargetURLtobehandledwithaspecificcontent-handler,41hash-typemaps,creatingwithRewriteMapdirective,64–65homepage,matching,17–18hostnamesusingRewriteConddirectivetoresolveproblemsassociatedwith,105whatworksanddoesn'twork,102.
htaccessfilesenabling,28importanceofremovingleadingslashfromRewriteRule,106performancedegradationfromuseof,34RewriteRulein,128–130HTTP403Forbiddenstatuscode,flagforforcing,40HTTP410Gonestatuscode,causingApachetosend,40httxt2dbmutility,forgeneratingaDBMfileforusebyRewriteMapdirective,65Iimagetheftcurtailing,53preventingfromyourwebsite,95–97Includeconfigurationdirective,forkeepingtrackofvirtualhostconfigurationfiles,100installationdocumentation,forinstallingApachewebserver,22installingandconfiguringmod_rewrite,21–30installingfromsourcemod_rewriteasasharedobject,23–25mod_rewriteasastaticallycompiledmodule,23int:maptypecreatingwithRewriteMapdirective,67internalRewriteMapfunctionnames,67internalfunctionnames,forinternalRewriteMap,67IP-basedvirtualhostsvs.
name-basedvirtualhosts,99L-ltestflag,usingtoseeiftheTestStringexistsasafilepathandisasymboliclink,54[L]orLastflagforindicatingtheendoftherewritingprocesshasbeenreached,41fortellingtherewriteenginewe'redone,62Lastor[L]flag,forindicatingtheendoftherewritingprocesshasbeenreached,41Lifetimeargument,forsettinghowlongacookieshouldberetained,38LoadModuledirectives,inconfigurationfiles,26–27loghandlers.
Seepipedloghandlersloggingcommoncomplaintaboutmod_vhost_alias,104formassvirtualhosts,109–111loopingavoidanceof,126–128preventingbyusingRewriteConddirective,56–57usingconditionalrewritesfor,79–81loopingrewriterule,defined,79Mmassvirtualhosting,2–3loggingfor,109–111MasteringRegularExpressions,SecondEdition,byJeffreyFriedl(O'Reilly,2002),7,133INDEX138matching,oneofagroupofcharacters,13MaxRedirectsoption,forsettingredirectionlimit,56metacharacter,defined,9mod_ext_filter,websiteaddressfordocumentationfor,118mod_proxyuseofbymod_rewritetoforcerequeststoanotherserver,113–121websiteaddressforfulldocumentationfor,121mod_proxy_html,websiteaddressforinformationabout,116mod_proxy_http,inApache2.
x,113mod_rewriteaccesscontrolwith,91–94binaryinstallation,25–27booksaboutregularexpressions,133checkingtoseeifitisinstalled,29creatingcleanURLswith,2creatingper-lettersubdirectorieswith,106denyingaccesstoaparticulardirectorywith,91–93denyingaccesstoseveraldirectoriesatoncewith,93–94exampleerrormessagewhennotproperlyinstalled,28installing,22–28installingandconfiguring,21–30installingandconfiguringifyouarenotthesystemadministrator,28–29installingasasharedobjectonApache1.
3,24–25installingasasharedobjectonApache2.
x,25anintroductionto,1–6limitationsoftranslatingahostnameintoadirectorypathwith,2–3massvirtualhostingwith,104–109proxyingwith,117–120proxyingwithout,116RewriteRuledirectiveasmainworkhorseof,31–46testingwhetheritiscorrectlyinstalled,27–28useofmod-proxybytoforcerequeststoanotherserver,113–121usingaslastsolution,6usingforrenamingandreorganization,73–77usingtoadjustURLsfromonelayouttoanother,69–73usingtoproxyaparticularfiletype,117–118whennottouse,4–6whennottouseforaccesscontrolproblems,89–91whentouse,1–3mod_rewriteCookbook,websiteaddressfor,133mod_vhost_aliasconfiguringvirtualhostswith,101–104hostname-to-directorymappingprovidedby,6inflexibilityof,104modifierflags,forRewriteConddirective,55–56N{n,m}repetition,syntaxfor,16[N]orNextflag,forindicatingtherewritingprocessshouldberestartedfromthebeginning,41–42name-basedvirtualhostsvs.
IP-basedvirtualhosts,99[NC]ornocaseflag,usingtomakeaRewriteConddirectivecaseinsensitive,55[NC]orNoCaseflag,usingtomakeaRewriteRulecaseinsensitive,42[NE]orNoEscapeflag,usinginarewritetarget,42–43negation(!
),ofanentireregularexpressionmatch,13–14Nextor[N]flag,forindicatingtherewritingprocessshouldberestartedfromthebeginning,41–42NoCaseor[NC]flag,usingtomakeaRewriteRulecaseinsensitive,42NoEscapeor[NE]flag,usinginarewritetarget,42–43NoSubrequestor[NS]flag,usingwithRewriteRuledirective,43nocaseor[NC]flag,usingtomakeaRewriteConddirectivecaseinsensitive,55[NS]orNoSubrequestflag,usingwithRewriteRuledirective,43Oonlineresources,133openforwardproxy,risksassociatedwith,114–115[OR]orornextflag,usingwithRewriteConddirective,56ornextor[OR]flag,usingwithRewriteConddirective,56P[P]orProxyflag,usingwithRewriteRuledirective,43parentheses[()].
See()(parentheses)Passthruor[PT]flag,usingwithRewriteRuledirective,43–44PCREdocumentation,websiteaddressfor,20,134PCRE(PerlCompatibleRegularExpression)vocabulary.
Seeregularexpressionspcretestutility,forcomparingaregularexpressionagainstatestpattern,132per-dir(per-directory)contextexamples,34–35inRewriteRuledirective,32whennottouse,34per-direxamples,correlationbetweentheURIandwhatRewriteRulehastoworkwith,34per-directory(per-dir)context.
Seeper-dir(per-directory)contextperiod(.
)character.
See.
(period)characterINDEX139Finditfasterathttp://superindex.
apress.
com/PerlCompatibleRegularExpression(PCRE)vocabulary.
Seealsoregularexpressionswebsiteaddressfordocumentationfor,134Perlregularexpressiondocumentation,websiteaddressforobtaining,20permalinks,cleanURLsreferredtoas,2phonenumber,regexexamplefor,15–16PHPfiles,preventinguploadingandexecutionofbyusers,86–87pipedloghandlers,using,110–111plussign(+)character.
See^(caret)characterprg:rewritemaptypecreatingwithRewriteMapdirective,66–67exampleforreplacing-(dashes)with_(underscores),66–67proxiedcontent,modifying,118–119Proxyor[P]flag,usingwithRewriteRuledirective,43proxyrewriterules,113–114proxying,113–121toanapplicationserver,118excludingcontentfromtheproxy,119–120withmod_rewrite,117–120aparticularfiletypetoaback-endserver,117–118requesttooldserverifcontentisnotonnewserver,120withoutmod_rewrite,116ProxyPassdirectiveusinginsteadofmod_rewriteforproxying,113usingtoproxyasingledirectorytoanotherserver,116ProxyPassReversedirectivefunctionofwhenproxyingwithoutmod_rewrite,116useofwithRewriteConddirective,55ProxyRequestsdirective,usingtoforbidforwardproxying,114–115[PT]orPassthruflag,usingwithRewriteRuledirective,43–44Q[QSA]orQueryStringAppendflag,usingwithRewriteRuledirective,44questionmark()character.
See(questionmark)characterR[R]orRedirectflagindicatingthattherewriteisaredirectwith,62usingwithRewriteRuledirective,45randomizedrewrites,usingforloadbalancing,62–64Rebugdebuggerdisplayingvaluesassignedduringthematchingprocess,132websiteaddressforobtaining,19,131writteninPerltoprovideagraphicalfront-end,19–20Redirectdirectiveexamplesof,4–5usingRedirectMatchdirectiveinplaceof,6Redirector[R]flag,usingwithRewriteRuledirective,45redirecting,basedonclientconditions,83–87redirection,simpleasmostcommonmisuseofmod_rewrite,4–5RedirectMatchdirectiveusingformorecomplicatedredirects,5–6usingvs.
Redirect,6Redirects,usingRedirectMatchdirectiveformorecomplicated,5–6regexbuildingtools,fortestingregularexpressions,130–132RegexCoachavailableforWindowsandLinux,20websiteaddressforobtaining,132regexexamples,14–18regexsyntax,referencefor,7–14regextools,18–20RegularExpressionDebugger(Rebug),downloading,19,131regularexpressionexamples,14–18RegularExpressionRecipes:AProblem-SolutionApproach,byNathanA.
Good(Apress,2005),133regularexpressionsthebuildingblocksfor,7–14mod_rewritebuiltupon,7–20vocabularytable,8renamingandreorganization,usingmod_rewritefor,73–77requestvariables,forRewriteConddirective,49reverseproxying,functionof,114–115rewriteblock,exampleofflowof,52rewritelog,addingdirectivestoturnon,29–30rewritepattern,functionof,35rewriterules,usingmod_rewrite,3rewritetarget,thesecondargumentoftheRewriteRuledirective,35–37RewriteBasedirective,foralteringanimpliedbasepath,33RewriteConddirectiveadditionalvariablesthatcanbeusedin,52–53clientvariables,48–49date/timevariablesfor,50modifierflags,55–56otherspecialvariablesfor,50requestvariablesfor,49servervariablesfor,49specialtestflagsthatmaybeappliedto,54syntaxfor,47–48tableofvariables,48–50using,47–57using%(percentagesign)with,12usinginRewriteLogexample,126–128usingtopreventlooping,56–57RewriteCondpattern,53comparisontests,54INDEX140RewriteEngineOndirective,useof,124–126RewriteLogenabling,29–30,123amorecomplexrewriteexample,126–128asimpleexample,124–126usingRewriteCondinexample,126–128RewriteLogdirective,fordebuggingyourrewriterules,123–130RewriteLogLevel,setting,123RewriteMapdirectiveforcallingonsomethingexternaltohelpwithyourrewriting,59–67creatingonethatmapshostnamestodirectorypaths,108–109internalfunctionnames,67maptypesyoucancreatewith,59–67syntaxfor,59RewriteRulein.
htaccessfiles,128–130logfileentriesin.
htaccessfiles,129–130RewriteRulecontext,affectonApache'sbehaviorfromavarietyoflocations,32RewriteRuledirectiveexamplesofinefficientandsimplercodefor,80–81introductionto,31–46asmainworkhorseofmod_rewrite,31–46syntaxfor,32–35using[P]flagwithtomakeitaproxyrewriterule,113usingRedirectMatchinsteadof,5–6RewriteRuleflags,37–46rewrites,basic,69–77rnd:maptype,creatingwithRewriteMapdirective,62–64rnd:rewritetechnique,usingforotherrandomthings,63–64robot,usingmod_rewritetoblockfromhammeringyourwebsite,94–95S-stestflag,usingtoseeiftheTestStringexistsasafilepathandhasasizegreaterthanzero,54[S]orSkipflag,usingwithRewriteRuledirectivetoskipthenextnrules,45–46ScriptAliasMatchdirective,forresolvingissuesofCGIandscriptsservedasplaintext,107–108security,whenmod_proxyisenabled,114–115servervariables,forRewriteConddirective,49sharedobjectsvs.
staticallycompiledmodules,22–23simpleredirection,asmostcommonmisuseofmod_rewrite,4–5siterearrangement,usingmod_rewritefor,3Skipor[S]flag,usingwithRewriteRuledirectivetoskipthenextnrules,45–46.
so(sharedobject)file,22–23specialvariables,forRewriteConddirective,50spider,usingmod_rewritetoblockfromhammeringourwebsite,94–95split-logfilescript,forsplittingalogfileintoitscomponentparts,110SSLhost,solutiontoviewingthewronghost,76SSLRequireSSLdirective,functionof,77staticallycompiledmodule,installingmod_rewriteas,23staticallycompiledmodulesvs.
sharedobjects,22–23substitution.
Seerewritetarget"SwedishChef"translating,119websiteaddressfordetailsabout,119systemadministrator,installingandconfiguringmod_rewriteifyouarenot,28–29T[T]orTypeflagforsettingaMIMEtypeandforcingaparticularbehavior,41usingwithRewriteRuledirective,46testflagsexamplesusing,54–55thatmaybeappliedtoteststrings,54testnegation,byprefacingthepatternwithanexclamationmark(!
),54teststrings,testflagsthatmaybeappliedto,54text,anchoringtothestartandend,9–10third-partydistributions,ofApache,21–22time-basedredirection,usingRewriteConddirective,50–52troubleshooting.
Seedebuggingtxtmapfiles,creating,60–62txtmaptype,creatingwithRewriteMapdirective,60–62Typeor[T]flag,usingwithRewriteRuledirective,46U-Utestflag,usingtoseeiftheTestStringisavalidURLandisaccessible,54URI(UniformResourceIdentifier),5–6numURIs,matching,16–18URLmanipulation,mod_rewriteas"SwissArmyKnife"of,1URLpathinformation,rewritingtoaquerystring,69–73URLscreatingcleanwithmod_rewrite,2examplesforadjusting,69–73andRewriteRule'scorrespondinginterpretation,32rewritingandredirectingdynamically,1–3rewritingpathinformationtoaquerystring,69–73UseCanonicalNameOffdirective,fordisablingApache'sdefaultbehavior,110INDEX141Finditfasterathttp://superindex.
apress.
com/username,servingdifferentcontentbasedonuser's,84–85utilitiesapxs,24–25httxt2dbm,65pcretest,132Vvirtualhostsconfiguringwithmod_vhost_alias,101–104forhostname-to-directorymapping,6importanceofnotmixingtypesof,104loggingformultiple,110loggingtoasinglelogfileandthensplittingthelogfilelater,110theold-fashionedway,99–101problemoftoomanydirectories,103withRewriteMap,108–109rewriting,105–108forrunningmorethanonewebsiteonthesamephysicalserver,99–111typesof,99Wwebsite,ensuringthatallaccessesfirstvisitthefrontpage,85–86websiteaddressfor.
htaccesstutorial,28forApachewebserverinstallationdocumentation,22fordocumentationformod_ext_filter,118fordownloadingamod_rewritebinaryinstallationpackage,26fordownloadingRebugtool,19fordownloadingRegexCoach,20forfulldocumentationformod_proxy,121forinformationaboutcookies,39forinformationaboutfavicon.
icofilesandhowtocreatethem,126forinformationaboutmod_proxy_html,116forinformationaboutmod_vhost_alias,101forobtainingGNUTalkFilters,119forthePCREdocumentation,20forthePerlregularexpressiondocumentation,20INDEX142
wordpress高级企业自适应主题,通用型企业展示平台 + 流行宽屏设计,自适应PC+移动端屏幕设备,完美企业站功能体验+高效的自定义设置平台。一套完美自适应多终端移动屏幕设备的WordPress高级企业自适应主题, 主题设置模块包括:基本设置、首页设置、社会化网络设置、底部设置、SEO设置; 可以自定义设置网站通用功能模块、相关栏目、在线客服及更多网站功能。点击进入:wordpress高级企业...
ftech怎么样?ftech是一家越南本土的主机商,成立于2011年,比较低调,国内知道的人比较少。FTECH.VN以极低的成本提供高质量服务的领先提供商之一。主营虚拟主机、VPS、独立服务器、域名等传统的IDC业务,数据中心分布在河内和胡志明市。其中,VPS提供1G的共享带宽,且不限流量,还可以安装Windows server2003/2008的系统。Ftech支持信用卡、Paypal等付款,但...
傲游主机商我们可能很多人并不陌生,实际上这个商家早年也就是个人主机商,传说是有几个个人投资创办的,不过能坚持到现在也算不错,毕竟有早年的用户积累正常情况上还是能延续的。如果是新服务商这几年确实不是特别容易,问到几个老牌的个人服务商很多都是早年的用户积累客户群。傲游主机目前有提供XEN和KVM架构的云服务器,不少还是亚洲CN2优化节点,目前数据中心包括中国香港、韩国、德国、荷兰和美国等多个地区的CN...
rewritecond为你推荐
买虚拟主机购买虚拟主机时,应该注意点什么呢,...?.net虚拟主机想买个同时支持php和.net的虚拟主机,哪里可以买到这样的空间?是同时支持的那种。asp主机请问虚似主机和Asp服务器软件都是一个意思吗虚拟主机推荐谁可以给推荐下好用的虚拟主机域名注册查询如何查域名有没有被注册域名服务商比较专业的域名服务商有哪些?好的域名和域名服务商没关系吧?免费网站域名申请那里 可以申请免费的 网站域名啊??虚拟主机申请现在做网站申请虚拟主机选择哪种合适?jsp虚拟空间自己组建jsp虚拟主机运营,技术方面有哪些要求?网站空间商网站空间商的选择??
过期域名查询 域名查询系统 免费域名空间申请 vps优惠码 火山主机 sugarhosts 荣耀欧洲 softlayer linode代购 轻量 丹弗 ca4249 徐正曦 免费防火墙 免费申请网站 国外免费asp空间 如何安装服务器系统 服务器硬件防火墙 免费mysql数据库 谷歌台湾 更多