GetSimple Support Forum
Redirect my first page "index.php" to another page - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: Themes (http://get-simple.info/forums/forumdisplay.php?fid=10)
+--- Thread: Redirect my first page "index.php" to another page (/showthread.php?tid=3553)



Redirect my first page "index.php" to another page - darsanha - 2012-09-18

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


Redirect my first page "index.php" to another page - sal - 2012-09-18

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.


Redirect my first page "index.php" to another page - darsanha - 2012-09-18

Thanks Sal,
it's working well !