| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
jh0nny
Joined: 14 Mar 2007 Posts: 2
|
Posted: Wed Mar 14, 2007 10:48 pm Post subject: Rewrite memberlink |
|
|
Dear members,
I would love to use a rewrite system within this great mod which allows me to rename member1, member2 etc. to their nickname provided.
I know that some characters cannot be used, but that ain't a problem (clean board) in this case.
I just want to let the board handle the requests like this:
Admin posted .... and the profile of Admin has to be reached with this link: www.mysite.com/forum/admin and also for the other members on the board.
I only made it so far that the profile was reachable when entering the link: www.mysite.com/forum/1admin (1 can be everything, but cannot let it out?) with this code in my htaccess:
| Code: | | RewriteRule ^1(.*) profile.php?mode=viewprofile&uname=$1 [QSA,L] |
In the case above everything is working, but only with the digit (or anything else) before the code and does not automaticly edit all profilelinks, only links the entered name to the right profile.
And after that I choose this option ..
| Code: | | RewriteRule ^(.*) profile.php?mode=viewprofile&uname=$1 [QSA,L] |
But that totally screws up the pages (missing icons, links not working and an overall message of 'User does not excist' on other pages).
Anyway ....
I would love to have it shown as said above automaticly on all pages, just like the SEO mod does with the messagelinks etc, but with the usernames as the profilelink.
I hope you can make something out of my post and you can help me out with this one.
Thanks for your help.
(PS code itselve is in includes/usercp_viewprofile.php in my option) |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
Posted: Thu Mar 15, 2007 10:41 am Post subject: Re: Rewrite memberlink |
|
|
And welcome
Rewriting profile links with title injection is some work, as they are widely used within phpBB pages and the code isn't really centralised, unlike topic where all topics are grabbed at once, here, profile link are code wise of many type.
This mean you'll have to grab quite some user nickname in phpBB code, but it's doable.
Of course, this is only an option if you're only allowing A-Za-z0-9_- for your user names, otherwise, phpBB would not be able to handle all cases, as format_url( "{bob}" ) = format_url ( "bob") = bob for example, even though bob and {bob} would still be two different members.
I'm not sure about what you really want to do, as admin/ does not seems to be the dmin nick name here.
For your rewriterule, you can use a slightely different one to handle the profiles as you wish :
| Code: | RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(([a-zA-Z0-9]+)[^/]$ profile.php?mode=viewprofile&uname=$1 [QSA,L] |
After the other forum rewriterules should do it to redirect :
example.com/admin to profile.php?mode=viewprofile&uname=admin
The rule set first checks if the requested uri is not a file or folder or symlink, and then redirect with an extra condition, there should not be a slash at the end.
Hope this helps
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
HB phpBB SEO Team

Joined: 16 Oct 2006 Posts: 795
|
Posted: Thu Mar 15, 2007 12:17 pm Post subject: Re: Rewrite memberlink |
|
|
How about a "pseudo" directory for members? For example, /forums/ and /members/bob.
| Code: | | RewriteRule ^members/([a-zA-Z0-9]+)$ /forums/profile.php?mode=viewprofile&uname=$1 [QSA,L] |
|
_________________ Dan Kehn |
|
| Back to top |
|
 |
jh0nny
Joined: 14 Mar 2007 Posts: 2
|
Posted: Thu Mar 15, 2007 1:13 pm Post subject: Re: Rewrite memberlink |
|
|
First off all, thanks for the replies!
I tried to make a 'virtual' path like you did with /members but the software doesn't understand where the images have to be and looks inside the members/templates/etc. for them.
I have no problem with the way you suggested btw, but it has to work hihi.
I was also looking at the advanced SEO mod where the topic titles/forums etc. can be named with the name provided by the admin like 'Football', that's the thing I also want for my profilelinks, no longer with the id's and long links but just like www.site.com/admin (or Joost/Bart/John etc.), or with the solution given earlier.
I simply don't have the knowledge to do this myselve and doubt that it can be done by only using the mod rewrite functions and leaving the phpBB code in tact, which is not needed for me btw.
I hope you understand me.  |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 13354
|
|
| Back to top |
|
 |
|
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |