Skip to Content Skip to Menu

ysva User Profile URL Redirection *Version 2*

  • safa
  • safa
  • OFFLINE
  • Posts: 12
  • Thanks: 0
  • Karma: 1
17 years 8 months ago #32966 by safa
Figured out solution, and posting as it might be useful for others. It requires a hack of /administrator/components/com_sef/core/sef.resolver.php

Change (around line 600):

[code:1] function error404( $requestURL ) {
global $database;
$errorHeader = 'HTTP/1.1 404 Not Found';
$errorURL = $this->config->validate_404_url;
if (!$errorURL) {
$language = ($GLOBALS != '' ?
$GLOBALS : 'english');
@include_once( 'language/' . $language . '.php' );
while (@ob_end_clean());
header( $errorHeader );
die( defined( '_NOT_EXIST' ) ? _NOT_EXIST : '404 Not Found' ); [/code:1]

to

[code:1] function error404( $requestURL ) {
global $database;
$errorHeader = 'HTTP/1.1 404 Not Found';
$errorURL = $this->config->validate_404_url;
if (!$errorURL) {
$language = ($GLOBALS != '' ?
$GLOBALS : 'english');

@include_once('errorpagesef.php');
die();

/**@include_once( 'language/' . $language . '.php' );
while (@ob_end_clean());
header( $errorHeader );
die( defined( '_NOT_EXIST' ) ? _NOT_EXIST : '404 Not Found' ); */[/code:1]

Rename your original errorpage.php (put together below) to errorpagesef.php. I'd keep the basic server 404 page file completely plain and different from the php file you wrote below so that if it needs to call the 404 page file after it fails both OpenSEF or calls the above script, it does not go on an infinite loop.

Please Log in or Create an account to join the conversation.

  • ysva
  • ysva
  • OFFLINE
  • Posts: 47
  • Thanks: 0
  • Karma: 21
17 years 8 months ago #32967 by ysva
This is NOT to be used with SEF. (It still remains untested.)
This is a way to work around SEF, so if you already have it, search the forums for a SEF way, because that's different from this.

Please Log in or Create an account to join the conversation.

  • ysva
  • ysva
  • OFFLINE
  • Posts: 47
  • Thanks: 0
  • Karma: 21
17 years 8 months ago #32968 by ysva
safa wrote:

Figured out solution, and posting as it might be useful for others. It requires a hack of /administrator/components/com_sef/core/sef.resolver.php

Change (around line 600):

[code:1] function error404( $requestURL ) {
global $database;
$errorHeader = 'HTTP/1.1 404 Not Found';
$errorURL = $this->config->validate_404_url;
if (!$errorURL) {
$language = ($GLOBALS != '' ?
$GLOBALS : 'english');
@include_once( 'language/' . $language . '.php' );
while (@ob_end_clean());
header( $errorHeader );
die( defined( '_NOT_EXIST' ) ? _NOT_EXIST : '404 Not Found' ); [/code:1]

to

[code:1] function error404( $requestURL ) {
global $database;
$errorHeader = 'HTTP/1.1 404 Not Found';
$errorURL = $this->config->validate_404_url;
if (!$errorURL) {
$language = ($GLOBALS != '' ?
$GLOBALS : 'english');

@include_once('errorpagesef.php');
die();

/**@include_once( 'language/' . $language . '.php' );
while (@ob_end_clean());
header( $errorHeader );
die( defined( '_NOT_EXIST' ) ? _NOT_EXIST : '404 Not Found' ); */[/code:1]

Rename your original errorpage.php (put together below) to errorpagesef.php. I'd keep the basic server 404 page file completely plain and different from the php file you wrote below so that if it needs to call the 404 page file after it fails both OpenSEF or calls the above script, it does not go on an infinite loop.

could you explain what this does exactlyp?

Please Log in or Create an account to join the conversation.

  • ozz76
  • ozz76
  • OFFLINE
  • Posts: 6
  • Thanks: 0
  • Karma: 0
17 years 7 months ago #34560 by ozz76
Boys i got a problem.
I installed joomla in a subfolder and the profile_url doesn´t work,takes me to 404 error page.
i guess the htaccess must be different..
someone can help me??

my videomap www.soyculichi.com

Please Log in or Create an account to join the conversation.

  • insomnio
  • insomnio
  • OFFLINE
  • Posts: 4
  • Thanks: 0
  • Karma: 0
17 years 7 months ago #34634 by insomnio
Hi ysva!

could you post or send me a PMS or email with a copy of YOUR htaccess code?

my brother cant make this to work, and maybe he can use a working htaccess to modify the things that are wrong in my htaccess

hope i was clear enough

O, and another thing, does it makes a problem if Mikes URL redirect plugin is enabled?
its nice that it shows the URL for the users (i couldnt make it work neither, so i tried with your redirection and we get very close!

the problem is that the username is actually missing in the navigation bar, and the web says that the user wasnt found

chek it for yourself:

www.soycine.com.ar/insomnio (thats a user i create)
public access is allowed, so thats not the problem


well. hope that you can gime a hand here, I spent all night trnslating some plugins for the CB, so ill post them when im done.. thats the least i can do, after all the good things you (all CB friends) do!

greetings from Argentina!!!

mail: gallegopablo@gmail.com

Please Log in or Create an account to join the conversation.

  • Pijus887
  • Pijus887
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
17 years 6 months ago #36749 by Pijus887
Hi ysva, i'm using IIS and i get this error:

Warning: Cannot modify header information - headers already sent by (output started at D:\webs\HCC\profile_url.php:8) in D:\webs\HCC\profile_url.php on line 24

What i'm doing bad?

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum