How to write a PHP 301 redirect
Quick tip...
Code:
<?php Save it as index.php if you're redirecting a folder or site. Or some other PHP file that you're using as a redirect, i.e. theoldpage.php Note: You don't have to redirect to a file -- it can be a folder or domain, too. Examples: Code:
header('Location: http://www.somewhere.com/'); When the server is set to run HTML as PHP, simply save the code into a new HTML file -- i.e, index.html or index.htm The better solution is to use .htaccess when available. :thumb: |
Site design, images and content © 2002-2024 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2024 Jelsoft Enterprises Ltd.