PDA

View Full Version : changing ?profile=1 to /1



Princess$
22-12-2007, 12:53 PM
Hiya, i'm helping with a social network site and we want it to not come with the link "blah.com/profile.php?user=$id1 but want it blah.com/1

1 = replaces with username

i tried editing this code


RewriteEngine On
Options +Followsymlinks
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.* - [L,QSA]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/images/(.*)$ /images/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^.*/uploads_user/(.*)$ /uploads_user/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([0-9]+)/?$ /album_file.php?user=$1&album_id=$2&media_id=$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/?$ /album.php?user=$1&album_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/([0-9]+)/([^/]+)?$ /album.php?user=$1&album_id=$2$3 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/albums/?$ /albums.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([0-9]+)/?$ /blog_entry.php?user=$1&entry_id=$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/([^/]+)?$ /blog.php?user=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/blog/?$ /blog.php?user=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/?$ /profile.php?user=$1 [L]

I tried removing the profile.php?user= and leaving /$1 and the links change on the homepage, but when you click profiles it comes up with page not displayed for the profiles.

thankss to who can help.

tgb-hosting
22-12-2007, 01:00 PM
you could make it so it includes in index.php
so the address bar weould look like

www.domain.com/?profile=1

[Oli]
22-12-2007, 01:06 PM
you could make it so it includes in index.php
so the address bar weould look like

www.domain.com/?profile=1

That's exactly what he doesn't want...

he wants it to be www.domain.com/1 or www.domain.com/profiles/1
something like that.

Joe!
22-12-2007, 01:16 PM
RewriteEngine on
RewriteRule ^([^\/]+)/?$ /profile.php?user=$1 [L]

try that, im not sure it will work :s its just in the status signature script it has that extra slash in, and that seems to work? so im not sure, just give it a go :)

Princess$
22-12-2007, 01:41 PM
RewriteEngine on
RewriteRule ^([^\/]+)/?$ /profile.php?user=$1 [L]

try that, im not sure it will work :s its just in the status signature script it has that extra slash in, and that seems to work? so im not sure, just give it a go :)

nothings different, it just changes to blah.com/username/ but the page is still page not displayed.

Elliott$
22-12-2007, 01:43 PM
try deleting it all and writng:


INSERTUSERNAMEHERE[PLZ]

Edited by --ss-- (Forum Super Moderator): Please do not post pointlessly, It is obvious that isn't a real code.

Joe!
22-12-2007, 01:49 PM
Your server does have mod_rewrite enabled yes?

Princess$
22-12-2007, 02:13 PM
Your server does have mod_rewrite enabled yes?

all writing permissions yes.

Want to hide these adverts? Register an account for free!