Hi,
I am using Content Profile, Views and Automatic Aliases.
I created a Views page and one of the link is supposed to link to the 'default' content profile page (users/[user id]) but instead the link is taking the users to node/[user id] page which look quite different from the 'default' profile page. I have used Automatic Aliases to change node/[user id] to profile/[user id]. Now I want to redirect all profile/[user id] pages to users/[user id]
My question here is, what should I use for [user id]? I have tried % and * but none works...what should go after # and ? on admin/build/path-redirect/add page?
Thanks for your help.
BB
Comments
Comment #1
dave reidAdding your own rewrite rule in your site's .htaccess is the most guaranteed way. There is no support for wildcards in Path redirect, which is what you need.
Comment #2
blueblade commentedThanks Dave,
I have no idea how to rewrite rule in .htacess...is there any reason why wildcards is not supported in Path redirect?
BB
Comment #3
dave reidBecause they can't be reliably done through Drupal and it's interface as well as .htaccess rewrite rules can be. There are tons of articles out there teaching how to write rewrite rules.
Comment #5
nally commentedI'm hoping there's a different way to do this. I would like to redirect /users/XX pages to the associated content profile page. But .htaccess wouldn't have access to the relationship between the /users/XX page and the content profile page (i.e. the UID of the owner of the content profile node is the same as the XX user ID).
Thoughts on that?
THANKS!
Comment #6
blueblade commentedI have just tried writing a RewriteRule without luck.
What I want to do is to redirect URL from:
user/[uid]
to
users/[uid]
and the RewriteRule I have is
RewriteRule ^user/([0-9]+)$ /users/ [R]
but it didnt work....it looks like this wont do anything to the "user" part at all...can someone please point out what is not done correctly?
Many thanks.
BB
Comment #7
dave reidRewriteRule ^user/([0-9]+)$ /users/$1 [R,L]Comment #8
blueblade commentedHi Dave Reid,
Thank you so much for your kind help again and again. That line works perfectly. You have a great one!!
BB
Comment #10
blueblade commentedHi David,
Sorry for asking so many times but I have just noticed that my RewriteRule has stopped working. I did install/update a few modules in the past months but I cant find which module is causing the problem by deactivate them. Can this be an apache issue instead? Thanks in advanced for your help. Also, I will try to downgrade to Drupal 6.15 tomorrow to see if this is caused by Drupal 6.16.
Comment #11
blueblade commentedI have just uninstalled the Views-6.x-2.10 and RewriteRule ^user/([0-9]+)$ /users/$1 [R,L] is working again. will post this on Views issues page.