snipt

Ctrl+h for KB shortcuts

PHP

PHP: Redirect page

1
2
3
4
5
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: howareyou.php");
exit();
?>
https://snipt.net/embed/df1029b5984d7be9e3d79c678e3e3e0a/
/raw/df1029b5984d7be9e3d79c678e3e3e0a/
df1029b5984d7be9e3d79c678e3e3e0a
php
PHP
5
2019-07-23T18:55:26
True
False
False
Jan 18, 2013 at 09:24 AM
/api/public/snipt/53971/
php-redirect-page
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a><span class="nb">header</span><span class="p">(</span><span class="s2">&quot;HTTP/1.1 301 Moved Permanently&quot;</span><span class="p">);</span> </span><span id="L-3"><a name="L-3"></a><span class="nb">header</span><span class="p">(</span><span class="s2">&quot;Location: howareyou.php&quot;</span><span class="p">);</span> </span><span id="L-4"><a name="L-4"></a><span class="k">exit</span><span class="p">();</span> </span><span id="L-5"><a name="L-5"></a><span class="cp">?&gt;</span><span class="x"></span> </span></pre></div> </td></tr></table>
301, page, php, redirect