I've deleted a few albums but bots and humans have bookmarked these old albums.
I tried adding a simple .htaccess line but I can't seem to get it to work. Am I missing something?
RedirectMatch 301 ^/gallery/v/OpenHouse/(.*) http://www.londonicedawgs.com/gallery/main.php
RedirectMatch 301 ^/gallery/v/BOWLING/(.*) http://www.londonicedawgs.com/gallery/main.php
RedirectMatch 301 ^/gallery/v/Coloring_Contest/(.*) http://www.londonicedawgs.com/gallery/main.php
Without the redirects, when someone goes to one of these deleted albums, they get:
Quote:
Error
Item not found.
Back to the Gallery
Error Detail -
Error (ERROR_MISSING_OBJECT) : Parent 7 path OpenHouse
in modules\core\classes\helpers\GalleryFileSystemEntityHelper_simple.class at line 98 (GalleryCoreApi::error)
in modules\core\classes\GalleryCoreApi.class at line 1952 (GalleryFileSystemEntityHelper_simple::fetchChildIdByPathComponent)
in modules\core\classes\helpers\GalleryFileSystemEntityHelper_simple.class at line 53 (GalleryCoreApi::fetchChildIdByPathComponent)
in modules\core\classes\GalleryCoreApi.class at line 1901 (GalleryFileSystemEntityHelper_simple::fetchItemIdByPath)
in modules\rewrite\classes\RewriteSimpleHelper.class at line 45 (GalleryCoreApi::fetchItemIdByPath)
in ??? at line 0 (RewriteSimpleHelper::loadItemIdFromPath)
in modules\rewrite\classes\RewriteUrlGenerator.class at line 103
in modules\rewrite\classes\parsers\modrewrite\ModRewriteUrlGenerator.class at line 56 (RewriteUrlGenerator::_onLoad)
in init.inc at line 170 (ModRewriteUrlGenerator::initNavigation)
in main.php at line 197
in main.php at line 104
in main.php at line 88
in main.php at line 3
System Information
Gallery version 2.3.1
PHP version 5.3.0 apache2handler
Webserver Apache/2.2.11 (Win32) PHP/5.3.0
Database mysqli 5.1.36-community-log
Toolkits ImageMagick
Operating system Windows NT SERVER 5.0 build 2195 (Windows 2000 Professional Service Pack 4) i586
Browser Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0
Posts: 8339
actually anonymous users get a more generic error w/out all the details.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 8339
you may want to redirect in the errorpage
/modules/core/templates/ErrorPage.tpl
line ~65 something like:
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 11
That is right, I forgot I was logged in when I was testing it out but it still generates an error, Why not toss it back to the main page?
Posts: 11
The referrer is a bit messy but it works but I would like a proper 301 redirect so bots stop filling my error logs trying to hammer old albums.
Posts: 8339
would this work better?
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 11
Weird, it worked a couple times now it's not.
I'm also getting php errors in my error log.
Posts: 8339
yea, I would do this myself:: move the condition to the top of the page as so there is no output before:
you can remove the isAdmin check if you don't care to catch these yourself.
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 11
I tried it at the top last night too but still got "headers already sent"
Don't suppose I could add this to whatever file contains the header. Get it in before the header is sent.
Posts: 8339
look in modules/core/ErrorPage.inc for setResponseHeader
-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2
Posts: 1642
I'll handle this along the track you were following before ... as a redirect and avoid editing the core files if possible.
Some points:
1. What exactly did you mean by not being able to get the redirect to work?
2. Where in your htaccess did you place the lines?
3. Can you paste a copy of the htaccess?
4. Try adding a "[L]" or "[QSA, L]" after each line
--
dakanji.com