GetSimple Support Forum

Full Version: Redirect my first page "index.php" to another page
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I want to redirect my page "index.php" which is the first page (automatic) site to a page that is called "exposition.php."
I can not do it ...
I tried to put PHP code in my page "template.php"

Code:
<? php
header ('Location: http://www.lematgalerie.com/exposition.php');
?>

But when I type the URL of the site I have a 404

Is this a good method or should I add some code in the file. Htacces?

thank you
The way I handle this is to first of all create a redirect.php file in the same folder as your theme's template.php file. In this new PHP file paste the following:

Code:
<?php if(!defined('IN_GS')){ die('You cannot load this page directly.'); }

header("HTTP/1.1 301 Moved Permanently");
header("Location: " . get_page_meta_desc(false));

exit();

Then, log into your GetSimple install and edit the "index" page (it's slug will be "index"), under "Page Settings" change the "Page Template" to "redirect.php" and the "Meta Description" field to /exposition.php which is the page people will end up on if they try to access the home page.
Thanks Sal,
it's working well !