网络营销电子商务研究中心  
How to buy the best prescription safety glasses in Canada? Let's study!
Go Back   网络营销电子商务研究中心 > 网站建设 > ZenCart
User Name
Password
 
FAQ Members List Calendar Cheap Glasses

Reply
 
Thread Tools Display Modes
  #1   IP: 218.2.66.251
Old 2012-04-08, 07:59 AM
topvip topvip is offline
超级版主
 
Join Date: 2006-01-04
Posts: 1206
topvip 正向着好的方向发展
Default Zen Cart: Re-routing 404 errors to your index page

This custom 404 page is part of the default Zen Cart shopping cart framework. It is expected that you customize this 404 page by replacing the sample text with your own wording. You can edit the wording for the page by changing it in the /languages/english/html_includes/classic/define_page_not_found.php file. If your site is in a different language or uses a custom template, then the directory for changing the text would be different: you’d substitute your language for english and your template name for classic in the folder path.

The file that constructs this custom Zen Cart 404 page is located here: /includes/modules/pages/page_not_found/header_php.php. After displaying the “You’re trying to access a page that doesn’t exist” message, this file then inserts your web site’s sitemap.

Although the Zen Cart custom 404 page is a step up from the leave-me-stranded error page that shows up if nothing is configured on the web site for a custom 404 page, many webmasters feel that a page that sends any kind of message to the visitor that there has been an error creates bad karma. It’s common for me to simply re-route the bad request to the site’s home page, where users can then search for the product they want without feeling like they’ve started out on a bad foot. Here’s how to change your Zen Cart store so that 404 errors are simply routed back to the home page.

Open /includes/modules/pages/page_not_found/header_php.php. You should see two lines near the top of the file that look like this:

// tell the browser that this page is showing as a result of a 404 error:
header(‘HTTP/1.1 404 Not Found’);

Beneath the second line, you need to enter an HTTP command that tells the browser to go to the site’s home page. That command can be accomplished by the line shown below in bold.

// tell the browser that this page is showing as a result of a 404 error:
header(‘HTTP/1.1 404 Not Found’);
header(‘Location: /index.php’);

It should be intuitive that you can forward the 404 error response to whatever page you’d like by substituting the desired forwarding page in place of /index.php.

You can try:
header('location: http://www.bestpriceglasses.com');
header('location: /index.php');
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Install an Zen Cart Template topvip ZenCart 0 2009-08-23 05:35 PM
x-cart Template Editing Guide for 4.1.x topvip X-Cart 0 2009-04-15 11:42 PM
What are the Strongest Directories? smiling 网站链接开发 1 2007-07-28 09:26 PM
SupSite/X-Space 啟用Rewrite改良強化型 sunshine Discuz/SupeSite/X-Space 0 2007-03-13 11:48 AM
Building for the user and the bot. admin 建站交流 0 2006-01-17 03:54 PM

Prescription-glasses.com offers prescription glasses online at discount prices.
All times are GMT +8. The time now is 10:44 AM.


Powered by vBulletin Version 3.8.7
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.