Zen Cart Logo
Forums / General Questions / Redirect define page links

Redirect define page links

Locked

Views: 3,038

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
22 Aug 2008, 5:29 PM
#2
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Redirect define page links

Does anyone have any suggestions on this ?

Thanks

22 Aug 2008, 8:18 PM
#3
djdavedawson avatar

djdavedawson

Zen Follower

Join Date:
Jul 2005
Location:
Orlando, Fl
Posts:
343
Plugin Contributions:
0

Re: Redirect define page links

Ok, so a have searched the forum and the web for an answer.

The closest i've found was from the ZC forum which led me to this:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^MYSITE.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.MYSITE.com$
RewriteRule ^index.php$ "http://MYSITE.com//index.php?main_page=page_custom_page" [R=301,L]

However, this seems to want to redirect any page with index.php? to my custom_page; in addition, kicks back a "too many redirects"

Please HELP.......

DD

18 Oct 2008, 2:20 PM
#4
abcisme avatar

abcisme

Zen Follower

Join Date:
Jun 2006
Posts:
298
Plugin Contributions:
0

Re: Redirect define page links

I'm trying to figure this one out also. I want to redirect my main_page to an index.html page instead. Seems no one else can figure it out either! :(

18 Oct 2008, 7:31 PM
#5
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Redirect define page links

djdavedawson:

Hello,

I need to do a redirect from:

http://www.MYSTITE.com/index.php?main_page=page_3

to

http://www.MYSITE.com/index.php?main_page=custom_page

I tried this in .htaccess:

Redirect 301 /index.php?main_page=page_3 http://www.MYSITE.com/index.php?main_page=custom_page

but no worky.

Any suggestions ?

Thanks

DD

Modify or create /includes/languages/english/html_includes/YOUR_TEMPLETE/define_page_not_found.php file.

<?php
/* define_page_not_found.php
	This script is the last try to redirect the URI request to the
	correct page.
*/

	// Check URI $_SERVER['REQUEST_URI']
    switch (basename($_SERVER['REQUEST_URI'])){ 
      case 'index.php?main_page=page_3': // old page link
		header("HTTP/1.1 301 Moved Permanently"); // Tell them that the page has moved
		header("Location: index.php?main_page=custom_page"); // new page
        break;

   /*   case 'index.php?main_page=product_info&cPath=64_31&products_id=228': // old page link
		header("HTTP/1.1 301 Moved Permanently"); // Tell them that the page has moved
		header("Location: index.php?main_page=product_info&cPath=64_31&products_id=229"); // new page
        break;
  */
        default:
        echo '<p><strong>Pleace select you page from our site map below</strong></p>';
	} 
?>

Skip

18 Oct 2008, 7:44 PM
#6
skipwater avatar

skipwater

Totally Zenned

Join Date:
Jun 2008
Location:
Washington, DC
Posts:
775
Plugin Contributions:
1

Re: Redirect define page links

skipwater:

Modify or create /includes/languages/english/html_includes/YOUR_TEMPLETE/define_page_not_found.php file.

<?php /* define_page_not_found.php This script is the last try to redirect the URI request to the correct page. */ // Check URI $_SERVER['REQUEST_URI'] switch (basename($_SERVER['REQUEST_URI'])){ case 'index.php?main_page=page_3': // old page link header("HTTP/1.1 301 Moved Permanently"); // Tell them that the page has moved header("Location: index.php?main_page=custom_page"); // new page break; /* case 'index.php?main_page=product_info&cPath=64_31&products_id=228': // old page link header("HTTP/1.1 301 Moved Permanently"); // Tell them that the page has moved header("Location: index.php?main_page=product_info&cPath=64_31&products_id=229"); // new page break; */ default: echo '<p><strong>Pleace select you page from our site map below</strong></p>'; } ?>
> 
> Skip

Forgot in the admin you must set Admin > MyStore > Missing Page Check to 'Page Not Found'