https://www.icyphoenix.com/viewtopic.php?f=26&t=1119&p=17632#p17632
-----------------------------------
nims
Thu 12 Jul, 2007 18:03

Re: Rewrite Jpg Url-s In Album
-----------------------------------
OK I have done it but with some problems.
Its now successfully redirecting
www.domain.com/forum/album.php?username=someuser
to
www.domain.com/album/someuser/
But the problem is that its not picking the correct urls of images and other links since all the paths are relative. I need some help here.

Here is what I did : ********** PLEASE DO NOT TRY THIS YET **********


Open [b].HTACCESS file[/b]
[codeblock]
### Rewrite RULE FOR USER ALBUMS
RewriteRule ^album/([^/]+)/?$ /forum/album.php?username=$1 [QSA,L]
[/codeblock]
OPEN [b]album.php[/b]
FIND
[codeblock]
elseif (isset ($_GET['user_id']))
{
	$album_user_id = intval($_GET['user_id']);
}
[/codeblock]
AFTER ADD
[codeblock]
// Display album by username by Manish
elseif (isset ($_POST['username']))
{
	$album_user_name = $_POST['username'];
	$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
		AND user_id <> " . ANONYMOUS;
	if( !($result_1 = $db->sql_query($sql_1)) )
	{
		message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
}
elseif (isset ($_GET['username']))
{
	$album_user_name = $_GET['username'];
	$sql_1 = "SELECT * FROM ". USERS_TABLE . " WHERE username = '" . $album_user_name. "'
		AND user_id <> " . ANONYMOUS;
	if( !($result_1 = $db->sql_query($sql_1)) )
	{
		message_die(GENERAL_ERROR, 'Username '.$album_user_name.' does not exist', '', __LINE__, __FILE__, $sql_1);
	}
	$result_1 = $db->sql_query($sql_1);
	$fetch_1 = $db->sql_fetchrow($result_1);
	$album_user_id = $fetch_1['user_id']; 
	
}
// display album by username by Manish ends
[/codeblock]
OPEN [b]overall_header.tpl[/b]
Change the relative path of stylesheet to absolute
[codeblock]
<link rel="stylesheet" href="http://www.domain.com/forum/templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css">
[/codeblock]


