Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 04:02:08 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155545 Posts in 21716 Topics by 7737 Members
Latest Member: simpleguy3
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: New module: 404 redirect  (Read 1769 times)
Ruud
WebsiteBaker Org e.V.

Online Online

Posts: 2297



WWW
« on: March 23, 2011, 02:51:11 PM »

If you are using the method of redirecting 404 errors to a defined error-page, this module can help you to forward the visitor to the correct page.

It will allow you to create a list with url's (or a part of a url) where you expect wrong requests (ie. old google listings or removed pages) linked to a dropdown list where you can select the WB page is should redirect to.

Redirection is done with a 301 redirect ("Permanently moved"), so it will tell the search engine crawlers the correct url too.

Example link: http://www.allwww.nl/pages/websitebaker.php

Ruud

[edit]
31-08-2011 - Version 0.2
Now the redirect page selector shows pages in the same order as the normal pagetree

07-09-2011 - Version 0.3
Changed the module foldername into mod404. Numeric foldername gave unexpected problems when removing a "404" section in wb2.8.2. Note: upgrading is not possible, uninstall older versions first!

07-09-2011 - Version 0.4
Bugfix. the 404 folder was used in saving the settings.
« Last Edit: September 07, 2011, 04:42:21 PM by Ruud » Logged

Professional WebsiteBaker Solutions
BlackBird
AddOn Development
*
Offline Offline

Posts: 2069



WWW
« Reply #1 on: March 23, 2011, 05:05:59 PM »

Looks good and sound very helpful.
Logged

Alle großen Veränderungen beginnen im Kleinen
mr-fan

Offline Offline

Posts: 1556


WWW
« Reply #2 on: March 24, 2011, 04:14:40 PM »

Great Mod Ruud,

so far that im not able to create a whole module i used a Code Page for mapping pages.

Blackbird helped me a few weeks ago with the same thing that your module fits!

i used a simple PHP snippet:
Code:
<?php //ignore
$map = array(
'/pages/old-page.php'                             => 'http://www.url.com/newfolder/or-new-name.php',
'/pages/older-page.php'                             => 'http://www.url.com/newfolder/or-newer-name.php',
'' => '',
'' => '',
);

//echo $map[$_SERVER['REQUEST_URI']];
if ( isset( $map[$_SERVER['REQUEST_URI']] ) ) {
$new_loc $map[$_SERVER['REQUEST_URI']];
    
header ("HTTP/1.1 301 Moved Permanently");
    
header"Location: $new_loc);
    exit();
} else  { 
echo 
$map[$_SERVER['REQUEST_URI']];
}

best regards martin
Logged

 
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #3 on: March 25, 2011, 07:56:04 AM »

thx ruud, great modul and works well.  wink
Logged

Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #4 on: August 27, 2011, 10:21:01 AM »

Very handy module. Thanks Ruud!  grin
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
crnogorac081
AddOn Development
*
Offline Offline

Posts: 1706



« Reply #5 on: August 28, 2011, 08:27:56 PM »

Hi,

I also did something similar , but mostly for news..

You can take a look here: http://www.websitebaker2.org/forum/index.php/topic,22168.0.html

all best,
Ivan
Logged

Wow, I coded something myself: PM Messanger Modul ,Searchbox with suggestions
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #6 on: August 30, 2011, 11:01:32 PM »

Hm... the page selection menu doesn't respect the hierarchy of the pages. It first shows the 0-level pages, then the 1-level pages, then the 2-level pages, etc. Makes it almost unusable in big, complex sites.

It also shows pages titles, instead of menu titles or (preferably) urls

Can this be fixed?  rolleyes
« Last Edit: August 30, 2011, 11:05:35 PM by Argos » Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Ruud
WebsiteBaker Org e.V.

Online Online

Posts: 2297



WWW
« Reply #7 on: August 31, 2011, 10:44:26 AM »

It also shows pages titles, instead of menu titles or (preferably) urls
Can this be fixed?  rolleyes

Updated the module to v0.2 (see first post).
The page selector now is in the same order as the normal pagetree.
The list now shows: "Menu_title (Page_title)"

Ruud
Logged

Professional WebsiteBaker Solutions
Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #8 on: August 31, 2011, 10:49:35 AM »

You're the man!  grin
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #9 on: September 07, 2011, 08:19:56 AM »

hi, plz check: delete the section 404 redirect.
message: 0 not found

deleting not possible.

dbs
Logged

Ruud
WebsiteBaker Org e.V.

Online Online

Posts: 2297



WWW
« Reply #10 on: September 07, 2011, 09:33:48 AM »

I cannot reproduce this error.
Deleting of both a section as a full page works fine for me.

There are no special deleting routines in the module.
The settings are not linked to a single page, so they are not removed.
Deleting a "404" section is just what WB does on removing any other module/section.
Logged

Professional WebsiteBaker Solutions
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #11 on: September 07, 2011, 02:28:19 PM »

hm, ok, have tested on 2 installations, with the same error.
try to delete the section = 0 not found
must delete the whole page, maybe only my problem.
Logged

Argos
Moderator
**
Offline Offline

Posts: 2161


WWW
« Reply #12 on: September 07, 2011, 03:41:39 PM »

I can confirm that deleting is not possible.

Version 2.8.2, revision 1506.
Logged

Jurgen Nijhuis
Argos Media
Heiloo, The Netherlands
WB Showcase: http://www.mywebsitebaker.com/pages/showcase.php?v&category_id=1242&count=30
----------------------------------------------------------------
Please don't request personal support, use the forums!
Ruud
WebsiteBaker Org e.V.

Online Online

Posts: 2297



WWW
« Reply #13 on: September 07, 2011, 04:14:07 PM »

The "delete section" routines in WB2.8.2 were changed.
A test within that functionality fails if the module foldername is numeric.

A fixed version (0.3) is in the first post of this tread.
Note: do not upgrade, uninstall the old version first.
Logged

Professional WebsiteBaker Solutions
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #14 on: September 07, 2011, 04:34:43 PM »

modify.php lines 23,24,25 contains path modules/404 instead modules/mod404  wink
Logged

Ruud
WebsiteBaker Org e.V.

Online Online

Posts: 2297



WWW
« Reply #15 on: September 07, 2011, 04:43:05 PM »

Oops.. sorry

fixed in v0.4
Logged

Professional WebsiteBaker Solutions
dbs
WebsiteBaker Org e.V.

Offline Offline

Posts: 3719


WWW
« Reply #16 on: September 07, 2011, 04:49:08 PM »

all is fine now and works. thx  grin
Logged

Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!