Mod_rewrite Make_url_friendly For Users


Subject: Mod_rewrite Make_url_friendly For Users
Hey there...

i have had spend some hours to figure my problem out... also searched alot, but can find any docs about that...

Icy Phoenix has his own make_url_friendly function...
Quote:
includes/functions_rewrite.php
// Profile
'/(?<!\/)(.\/){0,1}' . PROFILE_MG . '\?mode=viewprofile((&)|(&)){0,1}' . POST_USERS_URL . '=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',

// Profile
"make_url_friendly('\10') . '-profile-u\5.html' . if_query('\6') . stripslashes('\9\10') . '</a>'",
.htaccess
RewriteRule ^.+-profile-u([0-9]*) ./profile.php?mode=viewprofile%{QUERY_STRING}&u=> RewriteRule ^.+-profile-u([0-9]*) ./profile.php?mode=viewprofile%{QUERY_STRING}&u=$1 [L]< [L]


I have changed this a bit, and have ATM this:
Quote:
includes/functions_rewrite.php
// Profile
'/(?<!\/)(.\/){0,1}' . PROFILE_MG . '\?mode=viewprofile((&)|(&)){0,1}' . POST_USERS_URL . '=([0-9]+)((&)|(&)){0,1}([^>]+>)(.*?)<\/a>/e',

// Profile
"make_url_friendly('\10') . '-user\5' . if_query('\6') . stripslashes('\9\10') . '</a>'",
.htaccess
RewriteRule ^.+-user([0-9]*) ./profile.php?mode=viewprofile%{QUERY_STRING}&u=> RewriteRule ^.+-user([0-9]*) ./profile.php?mode=viewprofile%{QUERY_STRING}&u=$1 [L]< [L]

Which results in: http://www.domain.com/NICKNAME-user2

But i want to have it like this (i need this for an dynamic image):
http://www.domain.com/member/NICKNAME/

I´ve played a bit with the make_url_friendly function to achieve that... the rewrite was ok, but the images on the profile were not displayed... due to the "member"-path

The next thing is... i dont really know for what the "\10" | "\6" in the make_url_friendly function stand for...

anyone can help me with that please?

Subject: Re: Mod_rewrite Make_url_friendly For Users
The main problem is that / is considered as path separator. So you must change the IMG base location, otherwise the browser won't be able to locate files.

Profile PM  
Subject: Re: Mod_rewrite Make_url_friendly For Users
Informpro wrote: [View Post]
The main problem is that / is considered as path separator. So you must change the IMG base location, otherwise the browser won't be able to locate files.


yupp... thats the problem...

i found a solution for this...

{FULL_SITE_PATH}{EMAIL_IMG}

then the image is correct... but i need to add this to all templates which are loaded on the profile, overall_header, overall_footer, profile_view_body

thats a lot of work...

so i was asking here if the is maybe a better/easier way...

Subject: Re: Mod_rewrite Make_url_friendly For Users
Try to look at the .cfg file.

Profile PM  
Subject: Re: Mod_rewrite Make_url_friendly For Users
Informpro wrote: [View Post]
Try to look at the .cfg file.


The images are not the only problem... also Urls are not working...

I know MG dont like the Mod_rewrite thing... but maybe he have a solution for this... (and/or someone else) 8)

Subject: Re: Mod_rewrite Make_url_friendly For Users
You need a special PHP file to be able to manage those links.

It's not so quick to explain how to deal, I can suggest the HTACCESS part:

Code: [Download] [Hide] [Select]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ip/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ip/users/index.php [L]
</IfModule>


So you can recall users from the "users" subfolder (for example: kugel.com/users/kugel/) but then you need to strip last subfolder and be able to query the value from users table (maybe the username_clean).

As I said, it's not quick and requires dealing with both HTACCESS and PHP code.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.8535s (PHP: 4% SQL: 96%)
SQL queries: 10 - Debug Off - GZIP Enabled