Constructing Links to Profiles
Links to profiles can be constructed manually for both authors and commenters using the following Movable Type template code:
For Commenters:
<a href="<mt:CGIPath><mt:CommunityScript>?__mode=view&id=<mt:CommenterID>"> <mt:CommenterName> </a>For Authors:
<a href="<mt:CGIPath><mt:CommunityScript>?__mode=view&id=<mt:AuthorID>"> <mt:AuthorName> </a>
Using Pretty Profile URLs ΒΆ
The profile URL syntax above is not aesthetically pleasing to most. Many of these links can be improved and made more SEO friendly by some simple Rewrite Rules that can be used in Apache and other web servers. For example, here is a URL to a user's profile:
http://www.foo.com/cgi-bin/mt/mt-cp.cgi?__mode=view&id=1
Which is, by the way, analogous to referencing the same user's profile via username:
http://www.foo.com/cgi-bin/mt/mt-cp.cgi?__mode=view&username=byrnereese
Some site administrators may wish to construct profile URLs like this:
http://www.foo.com/profiles/byrnereese
To do so, here is an Apache mod_rewrite that will transparently map a profile URL of your choice to the canonical profile URL structure of Movable Type:
RewriteRule ^/profiles/(.*)$ /cgi-bin/mt/mt-cp.cgi?__mode=view&username=$1 [P,L]
Adam
August 13, 2008 9:48 AM | Reply
As far as I can tell, the initial two suggestions up there just don not seem to work in the form given - just outputs mt-cp.cgi without any path information, creating all sorts of fun errors.
Byrne Reese
replied to comment from Adam
August 13, 2008 10:12 AM | Reply
This should now be fixed. Thank you for the feedback.
Adam
August 13, 2008 10:20 AM | Reply
That's working better. Is there still something missing, though? The profile pages generated don't seem to pick up the name of the blog they're being generated from:
http://www.onemanandhisblog.com/cgi-bin/mt/mt-cp.cgi?__mode=view&id=1
Byrne Reese
replied to comment from Adam
August 13, 2008 12:13 PM | Reply
Try adding a
blog_id=43parameter (where 43 is obviously the ID of the blog whose context you need to be in). See if that works.Mihai Bocsaru
March 14, 2009 12:00 PM | Reply
Assuming you implement:
/profiles/User Name
And the username contains spaces, movable type will return this error:
An error occurred close Unknown user
Nicolas Laplante
April 8, 2009 1:54 PM | Reply
Is there a way to link to profile pages using the display name instead of the username?