Arrow Home arrow Forums
larger font smaller font default font Fixed screen resolution Auto adjust screen size

Joomlapolis Forums  


<< Start < Prev 1 2 Next > End >>
url redirection to username via 404 Errorpage
Date: 2006/10/06 17:42 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
For the people with a windows host (Or any other way in which they cannot use Mod_Rewrite in their .htaccess) , it's not possible to do url redirection to someone's username like this:
http://www.scalaleerlingensite.nl/admin
to
http://www.scalaleerlingensite.nl/index.php? class="sb_quote">option=com_comprofiler&task=userProfile&user='admin'

I found an alternative.

When you try to go to
http://www.scalaleerlingensite.nl
you get redirected to my 404 errorpage.
I put in my 404.php some code that redirects the user to the profile.

This is the code:
<?php

$thingy = "'";
$publicviewset = "&Itemid=1";


if (!strstr($_SERVER['HTTP_HOST'],"www."))
{
header("Location:
http://www.".

$_SERVER['HTTP_HOST']."/index.php?option=com_comprofiler&task=userProfile&u

ser=".$thingy.substr($_SERVER['REQUEST_URI'],46).$thingy.$publicviewset);
}
else
{
header("Location:

http://".$_SERVER['HTTP_HOST']."/index.php?option=com_comprofiler&task=user

Profile&user=".$thingy.substr($_SERVER['REQUEST_URI'],50).$thingy.$publicvi

ewset);
}
?>

Enter this into your 404.php file.
Then get the address to your php file, which is for me:
http://scalaleerlingensite.nl/404.php
You need to count the number of characters that this address contains. For me this is 46 characters. I entered this number in the code (look for the number 46 in the code above so you can see where I put it).

You can also see that there is an "else" in the code.
That's my redirection for if someone is on
http://www.scalaleerlingensite.nl
which is with my www. subdomain.
For this you need to go to your 404 file, with the subdomain, which for me is:
http://www.scalaleerlingensite.nl/404.php
and again count the number of characters. For me this is 50, and you can see the number in my code so you know where to enter it.

There! Now you have your own url redirection system!
Have fun with it
ysva

Post edited by: ysva, at: 2006/10/08 11:12
Click here to see the profile of this user The topic has been locked.

Re:url redirection on windows
Date: 2006/10/06 20:46 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
I deleted this post myself.
Please go to page 2.

Post edited by: ysva, at: 2006/10/08 11:11
Click here to see the profile of this user The topic has been locked.

Re:url redirection on windows
Date: 2006/10/06 22:21 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
I deleted this post myself.
Please go to page 2.

Post edited by: ysva, at: 2006/10/08 11:11
Click here to see the profile of this user The topic has been locked.

Re:url redirection on windows
Date: 2006/10/07 15:12 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
I deleted this post myself.
Please go to page 2.

Post edited by: ysva, at: 2006/10/08 11:11
Click here to see the profile of this user The topic has been locked.

Re:url redirection on windows
Date: 2006/10/07 15:32 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
I deleted this post myself.
Please go to page 2.

Post edited by: ysva, at: 2006/10/08 11:12
Click here to see the profile of this user The topic has been locked.

Re:url redirection on windows
Date: 2006/10/07 15:45 By: ysva Status: User  
Karma: 17  
Gold Joomlapolitan

Posts: 222
graphgraph
I deleted this post myself.
Please go to page 2.

Post edited by: ysva, at: 2006/10/08 11:12
Click here to see the profile of this user The topic has been locked.

<< Start < Prev 1 2 Next > End >>

Documentation

Documentation Subscription Service
(updated for CB 1.2 RC2)

What?

Why?

Where?

Just click here for answers!

Click here for a yearly subscription: subscribe now

Download Latest Release

The latest stable Community Builder Release is version 1.1 for Joomla 1.0 and Mambo.
You need to be a registered member of Joomlapolis to download.

The latest release candidate of Community Builder is version 1.2 RC3, native for Joomla 1.0, 1.5 and Mambo.
It is available as "thank you" to all CB documentation subscribers at this time.

CB Login