Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect my first page "index.php" to another page
#1
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
Reply
#2
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.
Modern UI Admin for GetSimple
Watch the demo. Install this plugin. Use this CSS. Enjoy.
Reply
#3
Thanks Sal,
it's working well !
Reply




Users browsing this thread: 1 Guest(s)