Jump to content

Vanity Url for User Profiles?


Modernvox

Recommended Posts

That does show a profile page, but the url would look like

http://my.domain.com/view.php?id=1

 

but I dont see it as a vanity url as the topic title suggests.

I think a vanity url would look like this:

http://my.domain.com/profile/Username

 

which u can accomplish with a script like premiso shows to display a profile page, but instead of the id, u will be using the username.

with that accomplished, you will need Apache ModRewrite in order to take the vanity url and process it into a script url

 

if you modify the view php to handle username lookups instead of id lookups

http://my.domain.com/view.php?username=Test1

 

you can use mod-rewrite to use a url like above with .htaccess like

RewriteEngine on
RewriteRule ^profile/([^/\.]+)$ view.php?username=$1 [L]

 

 

That does show a profile page, but the url would look like

http://my.domain.com/view.php?id=1

 

but I dont see it as a vanity url as the topic title suggests.

I think a vanity url would look like this:

http://my.domain.com/profile/Username

 

which u can accomplish with a script like premiso shows to display a profile page, but instead of the id, u will be using the username.

with that accomplished, you will need Apache ModRewrite in order to take the vanity url and process it into a script url

 

if you modify the view php to handle username lookups instead of id lookups

http://my.domain.com/view.php?username=Test1

 

you can use mod-rewrite to use a url like above with .htaccess like

RewriteEngine on
RewriteRule ^profile/([^/\.]+)$ view.php?username=$1 [L]

 

Ok will read up on this and repost when I get somewhere, Thanks guyz!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.