HomeUnityBlogs
 
 
sunnyone341

Permalinks for profiles not working

I have revised 99php.ini file to have Rewrite Engine On.  Put htaccess file with the following in the root folder of the domain name holding the Dolphin software:  

<IfModule mod_rewrite.c>
RewriteEngine on

# RewriteRule ^profile\.php rewrite_name.php [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
RewriteRule [A-Za-z0-9_-]+ rewrite_name.php [L]
</IfModule>

Chmod .htaccess file 644.  Links to users profile using the friendly permalinks does not work.  Permalinks using Wordpress DOES work, without any workarounds needed.  

Any help?
bad
0
good
 
 

Comments

mrpowless
mrpowless 318 days agocomment permalink
 
Hi there I answered this on the forums
http://tinyurl.com/yw6bj2
 
bad
0
good
 
 
smokkky
smokkky 316 days agocomment permalink
 
Hi mrpowless, I did exactly you told there (copied below) but it did not worked for me. Permalinks are still not working and "500 Internal Server Error" is occuring.

Can you please suggest me what may wrong?

-- Quoted --
mrpowless wrote
-------------
I'd try to uncomment:

# RewriteRule ^profile\.php rewrite_name.php [L]

so it looks like:

RewriteRule ^profile\.php rewrite_name.php [L]

from existing .htaccess an make it look for rewrite_name.php



then load below up in a file and save as type "all" name it rewrite_name.php

edit:goes inroot ty for pointing that out



<?php
/***************************************************************************
* Dolphin Web Community Software
* -------------------
* begin : Mon Mar 23 2006
* copyright : (C) 2006 BoonEx Group
* website : http://www.boonex.com
*
*
*
****************************************************************************/

/***************************************************************************
*
* This is a free software; you can modify it under the terms of BoonEx
* Product License Agreement published on BoonEx site at http://www.boonex.com/downloads/license.pdf
* You may not however distribute it for free or/and a fee.
* This notice may not be removed from the source code. You may not also remove any other visible
* reference and links to BoonEx Group as provided in source code.
*
***************************************************************************/

@list($url, $vars) = explode('?', $_SERVER['REQUEST_URI']);
if( $url == '/' )
{
require_once('index.php');
exit;
}


$urlArr = explode('/', $_SERVER['REQUEST_URI']);
$rewriteNick = (strlen(trim($urlArr[count($urlArr) - 1])) ? $urlArr[count($urlArr) - 1] : $urlArr[count($urlArr) - 2]);
if ( !get_magic_quotes_gpc() )
{
$rewriteNick = addslashes($rewriteNick);
}

$flag = 0;
$tmp = $rewriteNick;

if (preg_match("/^rewrite_name\.php\?ID=(\d+)/",$rewriteNick,$m))
{
$flag = 1;
$rewriteNick = " `ID` = '" . (int)($m[1]) . "'";
}
elseif (preg_match("/^profile\.php\?ID=(\d+)/",$rewriteNick,$m))
{
$flag = 2;
$rewriteNick = " `ID` = '" . (int)($m[1]) . "'";
}
elseif (ereg("([a-z0-9]+.php)",$rewriteNick,$m)) {
Header( "Location: {$rewriteNick}" );
exit;
}
else
{
$rewriteNick = " `NickName` = '$rewriteNick'";
}

require_once( "inc/header.inc.php" );
require_once( BX_DIRECTORY_PATH_INC .'db.inc.php' );

$sRequest = "SELECT `ID`,`NickName` FROM `Profiles` WHERE {$rewriteNick}";
$profArr = db_arr( $sRequest );

if ($profArr)
{
$_REQUEST['ID'] = $profArr['ID'];
if( $flag )
{
header("Location: " . $site['url'] . $profArr['NickName']);
}
require_once( BX_DIRECTORY_PATH_ROOT. 'profile.php' );
exit();
}
else
{
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
echo "Page not found $tmp";
}

?>
 
bad
0
good
 
 
sunnyone341
sunnyone341 315 days agocomment permalink
 
It worked fine for me after I uploaded mrpowless' suggestions. Thanks. I hope these suggestions are included in the next Dolphin release.

Smokky - I would try to chmod the file to 644, make sure it is in the root folder where Dolphin is. Make sure you have mod rewrite engine on in the base of your server.
 
bad
0
good
 
 
jonbrennan
jonbrennan 236 days agocomment permalink
 
FYI. I use 1and1 shared hosting and this did not work until I added RewriteBase / to .htaccess which looks like the following:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^profile\.php rewrite_name.php [L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule .+ - [L]
RewriteRule [A-Za-z0-9_-]+ rewrite_name.php [L]
</IfModule>

Use in good health.
 
bad
0
good
 
View 1 replies to this comment
 


Post a Comment

Please login to post a comment.

This Post
 
 
sunnyone341 Blog
All Blogs
Found a bug? Have a suggestion? We really value your feedback!
 
© 2008 BoonEx Ltd
ABN 27 127 966 581
 
PET:0.971440076828