The following warnings occurred:
Warning [2] Undefined array key "threadviews_countguests" - Line: 745 - File: showthread.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php 745 errorHandler->error_callback
Warning [2] Undefined array key "allowautourl" - Line: 584 - File: inc/class_parser.php PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/class_parser.php 584 errorHandler->error_callback
/inc/class_parser.php 228 postParser->parse_mycode
/inc/functions_post.php 830 postParser->parse_message
/showthread.php 1121 build_postbit
Warning [2] Undefined property: MyLanguage::$thread_modes - Line: 46 - File: showthread.php(1650) : eval()'d code PHP 8.1.31 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/showthread.php(1650) : eval()'d code 46 errorHandler->error_callback
/showthread.php 1650 eval




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple Redirect Page Template
#1
Copy the following PHP code and paste the contents into a file named redirect.php in your theme folder.

e.g. /theme/Innovation/redirect.php

Then whenever you need redirect a specific page just select "redirect.php" as your page template and set the "Tags & Keywords" in the Page Options of your page to the new URL.

The result will be a Permanently redirect to the new page.

This template will attempt three different redirects.
1) 301 Redirect (which should work)
2) Header Meta Redirect
3) Javascript Redirect



PHP Code:
<?php if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
/****************************************************
*
* @File:         redirect.php
* @Package:        GetSimple
* @Action:        Innovation theme for GetSimple CMS
*
*****************************************************/
# This is a special template page for the purpose of redirecting users to another page.
# Set "Tags & Keywords:" on the Page Pptions to the URL of the new page.
Header("HTTP/1.1 301 Moved Permanently");
Header("Location: " get_page_meta_keywords(false));

?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Permanent Redirect</title>
        <meta http-equiv="refresh" content="0; url=<?php get_page_meta_keywords(); ?>" />
    </head>
    <body onload="window.location.assign('<?php get_page_meta_keywords(); ?>')">
        <h2>Permanent redirect to: <a href="<?php get_page_meta_keywords(); ?>"><?php get_page_meta_keywords(); ?></a></h2>
    </body>
</html> 
Reply




Users browsing this thread: 2 Guest(s)