doc-exports/docs/obs/umn/en-us_topic_0066088957.html
zhangyue 7492b7b30f OBS UMN doc
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: zhangyue <zhangyue164@huawei.com>
Co-committed-by: zhangyue <zhangyue164@huawei.com>
2023-02-27 19:04:41 +00:00

32 lines
6.9 KiB
HTML

<a name="en-us_topic_0066088957"></a><a name="en-us_topic_0066088957"></a>
<h1 class="topictitle1">Configuring Redirection</h1>
<div id="body1499758606807"><p id="en-us_topic_0066088957__p30121176153913">You can redirect all requests for a bucket to another bucket or URL by configuring redirection rules.</p>
<div class="section" id="en-us_topic_0066088957__section6167532661"><h4 class="sectiontitle">Prerequisites</h4><p id="en-us_topic_0066088957__en-us_topic_0045853755_p1146611514350">Web page files of the static website have been uploaded to a bucket.</p>
<p id="en-us_topic_0066088957__en-us_topic_0045853755_p1812645682117">The static website files hosted in the bucket are accessible to anonymous users.</p>
<p id="en-us_topic_0066088957__en-us_topic_0045853755_p3350182614313">If the web page files are in the Cold storage class, restore them first. For more information, see <a href="obs_03_0320.html">Restoring Objects from the Cold Storage</a>.</p>
</div>
<div class="section" id="en-us_topic_0066088957__section11587693153957"><h4 class="sectiontitle">Procedure</h4><ol id="en-us_topic_0066088957__ol44271394154014"><li id="en-us_topic_0066088957__li99821455306"><span>In the bucket list, click the bucket you want to operate. The <strong id="en-us_topic_0066088957__obs_03_0307_b1395123914108">Overview</strong> page of the bucket is displayed.</span></li><li id="en-us_topic_0066088957__li18830181855820"><span>In the right <strong id="en-us_topic_0066088957__b579893112401">Basic Configurations</strong> area, click <strong id="en-us_topic_0066088957__b1579816319404">Static Website Hosting</strong>. The <strong id="en-us_topic_0066088957__b1979815314406">Static Website Hosting</strong> page is displayed.</span><p><p id="en-us_topic_0066088957__p1732877134316">Alternatively, you can choose <strong id="en-us_topic_0066088957__b5238144012014">Basic Configurations</strong> &gt; <strong id="en-us_topic_0066088957__b1024004072014">Static Website Hosting</strong> from the navigation pane on the left.</p>
</p></li><li id="en-us_topic_0066088957__li720344934317"><span>Click <strong id="en-us_topic_0066088957__b5556142185612">Configure Static Website Hosting</strong>. The <strong id="en-us_topic_0066088957__b17556942185614">Configure Static Website Hosting</strong> dialog box is displayed.</span></li><li id="en-us_topic_0066088957__li16729105453"><span>Enable it by turning on the status switch.</span></li><li id="en-us_topic_0066088957__li13201511640"><span>Set <strong id="en-us_topic_0066088957__b644395452019">Hosting By</strong> to <strong id="en-us_topic_0066088957__b14460357102014">Redirection</strong>. See <a href="#en-us_topic_0066088957__fig1131112528711">Figure 1</a> for details. Enter a bucket access domain name or URL in the text box of <strong id="en-us_topic_0066088957__b22561610132213">Redirect To</strong>.</span><p><div class="fignone" id="en-us_topic_0066088957__fig1131112528711"><a name="en-us_topic_0066088957__fig1131112528711"></a><a name="fig1131112528711"></a><span class="figcap"><b>Figure 1 </b>Configuring redirection</span><br><span><img id="en-us_topic_0066088957__image1816713085112" src="en-us_image_0145846362.png" title="Click to enlarge" class="imgResize"></span></div>
</p></li><li id="en-us_topic_0066088957__li48239657155648"><span>Click <strong id="en-us_topic_0066088957__b36028660">OK</strong>.</span></li><li id="en-us_topic_0066088957__li21017577482"><span>In the bucket list, click the bucket to which requests for the static website are redirected.</span></li><li id="en-us_topic_0066088957__li45818654181751"><span>(<strong id="en-us_topic_0066088957__en-us_topic_0045853755_b7869135132012">Optional</strong>) If the static website files in the bucket are not accessible to anonymous users, perform this step. If the static website files are already accessible to anonymous users, skip this step.</span><p><p id="en-us_topic_0066088957__en-us_topic_0045853755_p18712161416268">Authorize anonymous users the permission to read files on the static website. For details, see <a href="obs_03_0132.html">Authorizing Access Permissions to Anonymous Users</a>.</p>
<p id="en-us_topic_0066088957__en-us_topic_0045853755_p14415184985410">If the bucket contains only static website files, configure the <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b63305532481">Public Read</strong> policy for the bucket so that all files in it can be accessed publicly.</p>
<ol type="a" id="en-us_topic_0066088957__en-us_topic_0045853755_ol56026477144312"><li id="en-us_topic_0066088957__en-us_topic_0045853755_li26219314144346">Choose <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b1966141115407">Permissions</strong> &gt; <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b7671191919400">Bucket Policies</strong>.</li><li id="en-us_topic_0066088957__en-us_topic_0045853755_li820711719166">In the <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b137091459121110">Standard Bucket Policies</strong> area, select the <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b8285215161211">Public Read</strong> policy for the bucket.</li><li id="en-us_topic_0066088957__en-us_topic_0045853755_li588503161565">Click <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b9882162941218">Public Read</strong>. For details, see <a href="#en-us_topic_0066088957__en-us_topic_0045853755_fig15186794193556">Figure 2</a>. In the confirmation dialog box that is displayed, click <strong id="en-us_topic_0066088957__en-us_topic_0045853755_b1842219132">Yes</strong>.<div class="fignone" id="en-us_topic_0066088957__en-us_topic_0045853755_fig15186794193556"><a name="en-us_topic_0066088957__en-us_topic_0045853755_fig15186794193556"></a><a name="en-us_topic_0045853755_fig15186794193556"></a><span class="figcap"><b>Figure 2 </b>Configuring the public read permission</span><br><span><img id="en-us_topic_0066088957__en-us_topic_0045853755_image1956565091517" src="en-us_image_0129612765.png" title="Click to enlarge" class="imgResize"></span></div>
</li></ol>
</p></li><li id="en-us_topic_0066088957__li19484318154414"><span><strong id="en-us_topic_0066088957__b862293812442">Verification</strong>: Input the access domain name of the bucket in the web browser and press <strong id="en-us_topic_0066088957__b9751164710445">Enter</strong>. The bucket or URL to which requests are redirected will be displayed.</span><p><div class="note" id="en-us_topic_0066088957__note41738653155935"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="en-us_topic_0066088957__p25433685155943">In some conditions, you may need to clear the browser cache before the expected results are displayed.</p>
</div></div>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_03_0336.html">Static Website Hosting</a></div>
</div>
</div>
<script language="JavaScript">
<!--
image_size('.imgResize');
var msg_imageMax = "view original image";
var msg_imageClose = "close";
//--></script>