forked from laiweijian4/doc-exports
Reviewed-by: Sabelnikov, Dmitriy <dmitriy.sabelnikov@t-systems.com> Co-authored-by: zhangyue <zhangyue164@huawei.com> Co-committed-by: zhangyue <zhangyue164@huawei.com>
329 lines
27 KiB
HTML
329 lines
27 KiB
HTML
<a name="obs_04_0071"></a><a name="obs_04_0071"></a>
|
|
|
|
<h1 class="topictitle1">Configuring Static Website Hosting for a Bucket</h1>
|
|
<div id="body29678149"><div class="section" id="obs_04_0071__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0071__p22113956">OBS allows you to store static web page resources such as HTML web pages, flash files, videos, and audios in a bucket. When a client accesses these resources from the website endpoint of the bucket, the browser can directly resolve and present the resources to the client. This operation is applicable to:</p>
|
|
<ul id="obs_04_0071__ul64807877"><li id="obs_04_0071__li65776757">Redirecting all requests to a website endpoint.</li><li id="obs_04_0071__li55119905">Adding routing rules that redirect specific requests.</li></ul>
|
|
<p class="msonormal" id="obs_04_0071__p46399988">You can perform this operation to create or update the website configuration of a bucket.</p>
|
|
<p class="msonormal" id="obs_04_0071__p14946713">To perform this operation, you must have the <strong id="obs_04_0071__b14931727165717">PutBucketWebsite</strong> permission. By default, only the bucket owner can perform this operation. The bucket owner can grant the permission to other users by configuring the bucket policy or user policy.</p>
|
|
<div class="note" id="obs_04_0071__note302693"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p class="text" id="obs_04_0071__p26317097">Avoid using periods (.) in the destination bucket name. Otherwise, failures in client authentication certificate may occur when users use HTTPS for access.</p>
|
|
<p id="obs_04_0071__p130153912510">The maximum size of a network configuration request for a bucket is 10 KB.</p>
|
|
</div></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section2724241"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0071__screen51310142"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?website<span class="w"> </span>HTTP/1.1<span class="w"> </span>
|
|
Host:<span class="w"> </span>bucketname.obs.region.example.com
|
|
Content-Length:<span class="w"> </span>length
|
|
Date:<span class="w"> </span>date
|
|
Authorization:<span class="w"> </span>authorization
|
|
<span class="nt"><WebsiteConfiguration></span><span class="w"> </span>
|
|
<span class="w"> </span><span class="nt"><RedirectAllRequestsTo></span><span class="w"> </span>
|
|
<span class="w"> </span><span class="nt"><HostName></span>hostName<span class="nt"></HostName></span><span class="w"> </span>
|
|
<span class="w"> </span><span class="nt"></RedirectAllRequestsTo></span><span class="w"> </span>
|
|
<span class="nt"></WebsiteConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section24518174"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0071__p16222712">This request contains no message parameters.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section19336982"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0071__p38971268">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section12388580153122"><a name="obs_04_0071__section12388580153122"></a><a name="section12388580153122"></a><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0071__p23005493">This request contains elements to specify the website configuration in XML format.</p>
|
|
<ul id="obs_04_0071__ul5722851"><li id="obs_04_0071__li51505664">To redirect all website requests sent to the bucket's website endpoint, add the elements as described in <a href="#obs_04_0071__table51675244153340">Table 1</a>.
|
|
<div class="tablenoborder"><a name="obs_04_0071__table51675244153340"></a><a name="table51675244153340"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0071__table51675244153340" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Elements for redirecting all website requests</caption><thead align="left"><tr id="obs_04_0071__row41705179"><th align="left" class="cellrowborder" valign="top" width="37.76%" id="mcps1.3.5.3.1.2.2.4.1.1"><p id="obs_04_0071__p22676332">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.1%" id="mcps1.3.5.3.1.2.2.4.1.2"><p id="obs_04_0071__p22265530">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="7.140000000000001%" id="mcps1.3.5.3.1.2.2.4.1.3"><p id="obs_04_0071__p58335865">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0071__row46934697"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.3.1.2.2.4.1.1 "><p id="obs_04_0071__p43614089">WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.3.1.2.2.4.1.2 "><p id="obs_04_0071__p43080330">Root node configured on the website</p>
|
|
<p id="obs_04_0071__p52178654">Type: container</p>
|
|
<p id="obs_04_0071__p66954707">Ancestor: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.3.1.2.2.4.1.3 "><p id="obs_04_0071__p54622221">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row21837948"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.3.1.2.2.4.1.1 "><p id="obs_04_0071__p24043362">RedirectAllRequestsTo</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.3.1.2.2.4.1.2 "><p id="obs_04_0071__p1355276">Describes the redirection behavior for every request to this bucket's website endpoint. If this element is present, no other siblings are allowed.</p>
|
|
<p id="obs_04_0071__p12197486">Type: container</p>
|
|
<p id="obs_04_0071__p42668514">Ancestor: WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.3.1.2.2.4.1.3 "><p id="obs_04_0071__p33597646">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row33943358"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.3.1.2.2.4.1.1 "><p id="obs_04_0071__p65057507">HostName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.3.1.2.2.4.1.2 "><p id="obs_04_0071__p35166737">Name of the host where requests will be redirected</p>
|
|
<p id="obs_04_0071__p48065178">Type: string</p>
|
|
<p id="obs_04_0071__p29933423">Ancestor: RedirectAllRequestsTo</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.3.1.2.2.4.1.3 "><p id="obs_04_0071__p8688165">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row11084625"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.3.1.2.2.4.1.1 "><p id="obs_04_0071__p25439423">Protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.3.1.2.2.4.1.2 "><p id="obs_04_0071__p47327386">The HTTP or HTTPS protocol used in redirecting requests. The default protocol is HTTP.</p>
|
|
<p id="obs_04_0071__p23293291">Type: string</p>
|
|
<p id="obs_04_0071__p8313033">Ancestor: RedirectAllRequestsTo</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.3.1.2.2.4.1.3 "><p id="obs_04_0071__p2267061">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
<ul id="obs_04_0071__ul20403549"><li id="obs_04_0071__li49414213">To configure redirection rules, add the elements as described in <a href="#obs_04_0071__table103466791621">Table 2</a>.
|
|
<div class="tablenoborder"><a name="obs_04_0071__table103466791621"></a><a name="table103466791621"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0071__table103466791621" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Elements for adding rules that redirect requests</caption><thead align="left"><tr id="obs_04_0071__row33776425"><th align="left" class="cellrowborder" valign="top" width="37.76%" id="mcps1.3.5.4.1.2.2.4.1.1"><p id="obs_04_0071__p51535868">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="55.1%" id="mcps1.3.5.4.1.2.2.4.1.2"><p id="obs_04_0071__p55793492">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="7.140000000000001%" id="mcps1.3.5.4.1.2.2.4.1.3"><p id="obs_04_0071__p5484267">Mandatory</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0071__row38608158"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p40253071">WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p39273350">Root element for the website configuration</p>
|
|
<p id="obs_04_0071__p17915830">Type: container</p>
|
|
<p id="obs_04_0071__p27024744">Ancestor: none</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p41520671">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row38141726"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p2472111">IndexDocument</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p66023304"><em id="obs_04_0071__i1393303012018"><strong id="obs_04_0071__b84235270611955">Suff</strong></em> element</p>
|
|
<p id="obs_04_0071__p13933801">Type: container</p>
|
|
<p id="obs_04_0071__p58295349">Ancestor: WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p24302808">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row17398681"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p7039">Suffix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p570235"><em id="obs_04_0071__i1368215140509">Suffix</em> that is appended to a request initiated for a directory on the website endpoint. For example, if the <em id="obs_04_0071__i12943015018">suffix</em> is <strong id="obs_04_0071__b1493210111417">index.html</strong> and you request for <strong id="obs_04_0071__b104092231712">samplebucket/images/</strong>, the data that is returned will be for the object with the key name <strong id="obs_04_0071__b18131113611119">images/index.html</strong> in the <strong id="obs_04_0071__b10465444812">samplebucket</strong> bucket. <em id="obs_04_0071__i1433416117219">Suffix</em> cannot be empty or contain slashes (/).</p>
|
|
<p id="obs_04_0071__p50324942">Type: string</p>
|
|
<p id="obs_04_0071__p50271302">Ancestor: IndexDocument</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p45443636">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row6339540"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p43740750">ErrorDocument</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p53339852"><em id="obs_04_0071__i395419485146">Key</em> element</p>
|
|
<p id="obs_04_0071__p25560759">Type: container</p>
|
|
<p id="obs_04_0071__p28720240">Ancestor: WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p44638121">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row66198770"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p60500114">Key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p1562174">Object key that is used when a 4XX error occurs. This element identifies the page that is returned when a 4XX error occurs.</p>
|
|
<p id="obs_04_0071__p14059573">Type: string</p>
|
|
<p id="obs_04_0071__p59427295">Ancestor: ErrorDocument</p>
|
|
<p id="obs_04_0071__p65083615">Condition: Required when <strong id="obs_04_0071__b27333131">ErrorDocument</strong> is specified.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p37281482">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row67097887"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p66219790">RoutingRules</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p62202769"><strong id="obs_04_0071__b842352706111024"><em id="obs_04_0071__i26171333193119">Routing</em></strong> element</p>
|
|
<p id="obs_04_0071__p47335835">Type: container</p>
|
|
<p id="obs_04_0071__p23369333">Ancestor: WebsiteConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p13867814">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row57701462"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p43306852">RoutingRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p18194163">Element of a redirection rule. A redirection rule contains a <strong id="obs_04_0071__b233815314315">Condition</strong> and a <strong id="obs_04_0071__b178403347311">Redirect</strong>. When the <strong id="obs_04_0071__b48510384312">Condition</strong> is matched, <strong id="obs_04_0071__b164321642239">Redirect</strong> takes effect.</p>
|
|
<p id="obs_04_0071__p12419251">Type: container</p>
|
|
<p id="obs_04_0071__p44664400">Ancestor: RoutingRules</p>
|
|
<p id="obs_04_0071__p66435284">At least the <em id="obs_04_0071__i61046648">RoutingRule</em> element is required.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p45831469">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row9830039"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p58035722">Condition</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p3273021">Element for describing a condition that must be met for the specified redirection to apply.</p>
|
|
<p id="obs_04_0071__p29457190">Type: container</p>
|
|
<p id="obs_04_0071__p63788120">Ancestor: RoutingRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p66564100">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row62205992"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p5520559">KeyPrefixEquals</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p44512155">Object key name prefix when the redirection is applied.</p>
|
|
<p id="obs_04_0071__p65065083">Example:</p>
|
|
<ul id="obs_04_0071__ul48714836"><li id="obs_04_0071__li35780345">To redirect the request for object <strong id="obs_04_0071__b1657910281444">ExamplePage.html</strong>, the <strong id="obs_04_0071__b44971861252">KeyPrefixEquals</strong> is set to <strong id="obs_04_0071__b717614416414">ExamplePage.html</strong>.</li></ul>
|
|
<p id="obs_04_0071__p12526799">Type: string</p>
|
|
<p id="obs_04_0071__p45632331">Ancestor: Condition</p>
|
|
<p id="obs_04_0071__p8037798">Condition: Required when the ancestor element <strong id="obs_04_0071__b277876411111">Condition</strong> is specified and sibling <strong id="obs_04_0071__b32773974">HttpErrorCodeReturnedEquals</strong> is not specified. If two conditions are specified, both conditions must be true for the <strong id="obs_04_0071__b1341428155">Redirect</strong> to be applied.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p21083860">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row55537013"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p2204222">HttpErrorCodeReturnedEquals</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p44324263">HTTP error code returned after the <strong id="obs_04_0071__b134499595513">Redirect</strong> has taken effect. The specified <strong id="obs_04_0071__b18801173213613">Redirect</strong> is applied only when the error code returned equals this value.</p>
|
|
<p id="obs_04_0071__p33024155">Example:</p>
|
|
<ul id="obs_04_0071__ul28781946"><li id="obs_04_0071__li57710924">If you want to redirect requests to <strong id="obs_04_0071__b725603315714">NotFound.html</strong> when HTTP error code 404 is returned, set HttpErrorCodeReturnedEquals to 404 in <strong id="obs_04_0071__b192154552713">Condition</strong>, and set <strong id="obs_04_0071__b133391310105910">ReplaceKeyWith</strong> to <strong id="obs_04_0071__b8527202914817">NotFound.html</strong> in <strong id="obs_04_0071__b794043212814">Redirect</strong>.</li></ul>
|
|
<p id="obs_04_0071__p61115439">Type: string</p>
|
|
<p id="obs_04_0071__p13168044">Ancestor: Condition</p>
|
|
<p id="obs_04_0071__p51403539">Condition: Required when ancestor element <strong id="obs_04_0071__b54813684">Condition</strong> is specified and sibling <strong id="obs_04_0071__b23561115">KeyPrefixEquals</strong> is not specified. If multiple conditions are specified, the <strong id="obs_04_0071__b1984684712818">Redirect</strong> takes effect only after all conditions are met.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p26433854">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row36578099"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p10036032">Redirect</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p7612245">Element for redirection information. You can redirect requests to another host, to another web page, or with another protocol. You can specify an error code to be returned after an error.</p>
|
|
<p id="obs_04_0071__p1401347">Type: container</p>
|
|
<p id="obs_04_0071__p12612123">Ancestor: RoutingRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p14949049">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row323721"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p26221472">Protocol</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p43564450">Protocol used in the redirection request</p>
|
|
<p id="obs_04_0071__p56535736">Type: string</p>
|
|
<p id="obs_04_0071__p39059577">Ancestor: Redirect</p>
|
|
<p id="obs_04_0071__p15991880">Value options: <strong id="obs_04_0071__b4635163804611">http</strong>, <strong id="obs_04_0071__b20355640104613">https</strong></p>
|
|
<p id="obs_04_0071__p9709197">Condition: Not required if one of the siblings is present.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p48247493">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row31574258"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p7378140">HostName</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p60758495">Host name used in the redirection request.</p>
|
|
<p id="obs_04_0071__p9955545">Type: string</p>
|
|
<p id="obs_04_0071__p22491042">Ancestor: Redirect</p>
|
|
<p id="obs_04_0071__p1092787">Condition: Not required if one of the siblings is present.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p21406905">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row58444425"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p36377981">ReplaceKeyPrefixWith</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p60935378">Object key prefix used in the redirection request.</p>
|
|
<p id="obs_04_0071__p11547496">Example:</p>
|
|
<ul id="obs_04_0071__ul36818608"><li id="obs_04_0071__li62932017">To redirect all requests for (objects under) docs to (objects under) documents, set KeyPrefixEquals to docs in <strong id="obs_04_0071__b1272513361019">Condition</strong> and ReplaceKeyPrefixWith to documents in <strong id="obs_04_0071__b1145943910108">Redirect</strong>.</li></ul>
|
|
<p id="obs_04_0071__p43235912">Type: string</p>
|
|
<p id="obs_04_0071__p53578891">Ancestor: Redirect</p>
|
|
<p id="obs_04_0071__p12447974">Condition: Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p14876794">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row66782288"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p40656236">ReplaceKeyWith</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p4820780">Object key used in the redirection request. For example, redirect requests to <strong id="obs_04_0071__b12235823151119">error.html</strong>.</p>
|
|
<p id="obs_04_0071__p43387021">Type: string</p>
|
|
<p id="obs_04_0071__p54938872">Ancestor: Redirect</p>
|
|
<p id="obs_04_0071__p24687807">Condition: Not required if one of the siblings is present. Can be present only if <strong id="obs_04_0071__b33545144">ReplaceKeyPrefixWith</strong> is not provided.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p12235991">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0071__row43015060"><td class="cellrowborder" valign="top" width="37.76%" headers="mcps1.3.5.4.1.2.2.4.1.1 "><p id="obs_04_0071__p61667848">HttpRedirectCode</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="55.1%" headers="mcps1.3.5.4.1.2.2.4.1.2 "><p id="obs_04_0071__p29039755">HTTP status code returned after the redirection request</p>
|
|
<p id="obs_04_0071__p60031211">Type: string</p>
|
|
<p id="obs_04_0071__p3409992">Ancestor: Redirect</p>
|
|
<p id="obs_04_0071__p30689931">Condition: Not required if one of the siblings is present.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="7.140000000000001%" headers="mcps1.3.5.4.1.2.2.4.1.3 "><p id="obs_04_0071__p2856463">No</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li></ul>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section22791695"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0071__screen30046944"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>status_code
|
|
Date:<span class="w"> </span>date
|
|
Content-Length:<span class="w"> </span>length
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section3798667"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0071__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section34188005"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0071__p25846950">This response contains no element.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section39256590"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0071__p13228234">No special error responses are returned. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0071__screen8484163863919"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal"> 1</span>
|
|
<span class="normal"> 2</span>
|
|
<span class="normal"> 3</span>
|
|
<span class="normal"> 4</span>
|
|
<span class="normal"> 5</span>
|
|
<span class="normal"> 6</span>
|
|
<span class="normal"> 7</span>
|
|
<span class="normal"> 8</span>
|
|
<span class="normal"> 9</span>
|
|
<span class="normal">10</span>
|
|
<span class="normal">11</span>
|
|
<span class="normal">12</span>
|
|
<span class="normal">13</span></pre></div></td><td class="code"><div><pre><span></span>PUT<span class="w"> </span>/?website<span class="w"> </span>HTTP/1.1
|
|
User-Agent:<span class="w"> </span>curl/7.29.0
|
|
Host:<span class="w"> </span>examplebucket.obs.region.example.com
|
|
Accept:<span class="w"> </span>*/*
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>03:40:29<span class="w"> </span>GMT
|
|
Authorization:<span class="w"> </span>OBS<span class="w"> </span>H4IPJX0TQTHTHEBQQCEC:pUK7Yp0yebnq4P6gqzVjoS7whoM=
|
|
Content-Length:<span class="w"> </span>194
|
|
|
|
<span class="nt"><WebsiteConfiguration</span><span class="w"> </span><span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="w"> </span><span class="nt"><RedirectAllRequestsTo></span>
|
|
<span class="w"> </span><span class="nt"><HostName></span>www.example.com<span class="nt"></HostName></span>
|
|
<span class="w"> </span><span class="nt"></RedirectAllRequestsTo></span>
|
|
<span class="nt"></WebsiteConfiguration></span>
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0071__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0071__screen8485113814"><div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span class="normal">1</span>
|
|
<span class="normal">2</span>
|
|
<span class="normal">3</span>
|
|
<span class="normal">4</span>
|
|
<span class="normal">5</span>
|
|
<span class="normal">6</span></pre></div></td><td class="code"><div><pre><span></span>HTTP/1.1<span class="w"> </span>200<span class="w"> </span>OK
|
|
Server:<span class="w"> </span>OBS
|
|
x-obs-request-id:<span class="w"> </span>BF2600000164360D144670B9D02AABC6
|
|
x-obs-id-2:<span class="w"> </span>32AAAQAAEAABSAAgAAEAABAAAQAAEAABCSItqMZ/AoFUX97l1xx8s67V3cCQtXWk
|
|
Date:<span class="w"> </span>WED,<span class="w"> </span>01<span class="w"> </span>Jul<span class="w"> </span>2015<span class="w"> </span>03:40:29<span class="w"> </span>GMT
|
|
Content-Length:<span class="w"> </span>0
|
|
</pre></div></td></tr></table></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0070.html">Static Website Hosting</a></div>
|
|
</div>
|
|
</div>
|
|
|