Page 1 of 1

URL Rewriting created problems with thumbnails

Posted: 2011-07-13 17:30
by iKollect
I've used ADDT Server Behavior to generate Thumbnails ( InterAkt probably looks the same:Server Behaviors->+->Developer Toolbox->File Upload->Show Thumbnail)
I have changed the way the links of my project look, using a .htaccess file like this:

Code: Select all

RewriteEngine On RewriteRule ^page_name/([0-9-/|]+)/([0-9-]+)/?$ /Page.php?this=$1&that=$2 [NC,L] 
old url:

Code: Select all

http://www.mysite.com/mypage.php?this=1&that=2
new url:

Code: Select all

http://www.mysite.com/keywords/this/that 
but now the thumbnails I had aren't showing anymore: (must be because I'm using relative paths). Here is how ADDT code looks like:

// Show Dynamic Thumbnail
$objDynamicThumb1 = new tNG_DynamicThumbnail("", "KT_thumbnail1");
$objDynamicThumb1->setFolder("images/article/");
$objDynamicThumb1->setRenameRule("{rsArticle.Picture}");
$objDynamicThumb1->setResize(200, 0, true);
$objDynamicThumb1->setWatermark(false);

and lower in the php page to show the thumbnail:
<div><img border="0" src="<?php echo $objDynamicThumb1->Execute(); ?>" />bla bla bla

QUESTION: Is there a way to put absolute links here:
$objDynamicThumb1->setFolder("images/article/");
I've tried it, didn't work, or maybe i'm doing it wrong. Please give example.
Or if smbd has another solution, ANY SOLUTION, PLEASE POST, and stay on this topic cause i'll post answers quite fast.

Re: URL Rewriting created problems with thumbnails

Posted: 2011-07-13 19:59
by iKollect
Just found out that in order to put an absolute path, modifications have to be made into the tNG_DynamicThumbnail.class.php from the includes/tng/triggers folder, but I don't know what should be done.

Re: URL Rewriting created problems with thumbnails

Posted: 2011-07-14 17:37
by Fred
You are loosing the paths to the included js files

You have two options.
1. Use the html <base> tag

Code: Select all

<head>
<base href="http://www.invaliddomain.co.uk/your_includes_folder/" />
</head>
2. Specify the actual path for each file