How do I change the path to the home page for user blogs from:

eg. http://www.example.com/blog/1

to

eg. http://www.example.com/blog/username

I've seen it implemented at a few sample drupal sites, have the path module installed but can't see how I make this change so users can benefit from a more personalized blog url.

Comments

shane birley’s picture

You will need to set the path "blog/1" to the appropriate url alias.

1. administer > url aliases
2. add alias
3. "blog/1" to "blog/name_of_user"

Hope that helps.

-
Shane Birley
Vicious Bunny Creative
http://www.vbcreative.com

---
Shane Birley
Left Right Minds
https://www.leftrightminds.com

philipk’s picture

Quality!

So many neat little tricks!

chall3ng3r’s picture

i believe that a little script can do this at the time of user creation/registration. can you, or anyone help doing this?

TIA

// chall3ng3r //

sepeck’s picture

perhaps pathauto can do something like what you want. At least from the description it can.

-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

chall3ng3r’s picture

many thanks,

it worked just fine as required :D

// chall3ng3r //

capmex’s picture

Pathauto does exactly that automatically out of the box.
--
Free Templates

ekul08’s picture

I get it now.

yelvington’s picture

See previous discussion.

In my case we used wildcard DNS, mass_url and some changes in .htaccess (mod_rewrite). As a result, username.blufftontoday.com redirects to www.blufftontoday.com/blog/username, and mass_url translates that to the proper UID.

I am not using pathauto because I don't want the overhead of additional database lookups for every pageview. However, I don't have any metrics to demonstrate whether that actually is a problem.

comforteagle’s picture

Can you display what it is that you did to achieve that?? Please!!??

yelvington’s picture


RewriteCond %{HTTP_HOST} ^.+\.([^\.]+)\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/blog/%1

RewriteCond %{HTTP_HOST} ^([^\.]+)\.example\.com$ [NC]
RewriteCond %{HTTP_HOST} !^www\.example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/blog/%1

abqaria’s picture

i changed the example with my site's name but failed..
any ideas

in which directory should be the ht.accesss the "www"

cmb’s picture

A friend of mine wanted to do the same with user/NNN links, so I wrote a module for him.

Userpath Module

Take a look.

Ben

summit’s picture

Hi,

Is this Userpath module available for Drupal 5?
I found it at: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/userpath/
Can someone please update it otherwise?
Thanks in advance!

greetings,
Martijn