User Tools

Site Tools


creating_clean_profile_url_s

This is an old revision of the document!


Creating Clean Profile URL's

How to create more personalized profile URL's so they look like this … yoursite.com/username instead of looking like this … yoursite.com/profile.php?uid=1

Note: This will only work if your host allows mod rewrites.

Step 1. Open the .htaccess file located in your main Etano directory and add the following to the bottom of the file:

<IfModule mod_rewrite.c>
Options FollowSymLinks
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?user=$1 [L]
</IfModule> 

Note - if your script is installed in a subdirectory on your server and the above code doesn't seem to work then you might also need to include a RewriteBase statement, like so:

RewriteBase /subdirectory_name
<IfModule mod_rewrite.c>
Options FollowSymLinks
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ profile.php?user=$1 [L]
</IfModule> 

Step 2. Next open your skins_site/def/static/result_user.html file and replace the following:

<a class="link_bare" href="{tplvars.baseurl}/profile.php?uid={profile.fk_user_id}" title="{profile._user}"><img class="user_photo thumb1" src="{tplvars.photourl}/t1/{profile._photo}" alt="{profile._user}" /></a>
	<a class="content-link member_link" href="{tplvars.baseurl}/profile.php?uid={profile.fk_user_id}" title="{profile._user} profile">{profile._user}</a>, {profile.f1} 

With this:

<a class="link_bare" href="{tplvars.baseurl}/{profile._user}"><img class="user_photo thumb1" src="{tplvars.photourl}/t1/{profile._photo}" onerror="this.src='media/pics/no_photo.gif';" /></a>
	<a class="content-link simple" href="{tplvars.baseurl}/{profile._user}">{profile._user}</a>, {profile.f1} 

Step 3. After editing the above result_user.html file, in order for the changes to take effect you must regenerate your skin in the Admin » Site Setup » Skin Settings » section and then click regenerate under your default skin.

creating_clean_profile_url_s.1425911912.txt.gz · Last modified: 2015/03/09 09:38 by admin