Hello, i need some help. I just created a new site using drupal's built in table prefixing, so far my master and slave sites are sharing the same "users" table and i also enabled the built in single sign-on across my master and slave sites, cool.

I created the slave site to specifically handle storm (project management), so that i do not bug my master site with too many modules. I also intend to disable the blog and forum modules on the master site and create separate slave sites for them so that i can enable other complementary blog and forum helper modules on their separate slave sites, rather than running all these modules on the master site.

The problem is: the user profiles (built with content profile and displayed with panels) are displayed on the master site, i do not want to start enabling these modules on the slave sites, so i want every user on the slave sites to be redirected to the master site when their username is clicked.

What i want to achieve is this: when user A on slave site clicks on user B on slave site, user A is redirected to master site where they can view user B's profile. That is, clicking on www.example.com/slave/users/3 redirects automatically to www.example.com/users/3 and so on for all users.

How can i achieve this? I have tried Path Redirect with no success. I also tried this code on .htaccess file of slave site but it redirects to the frontpage of the master site:

RewriteRule ^users/(.*)$ http://example.com/users/* [R=301,L]

Please someone help. The wildcard (*) doesnt seem to be doing the trick for me

Comments

smartsystems160’s picture

I still havent been able to solve this solving since i created this issue. I just want my users on master and slave sites sharing one user table to be redirected to one site (master site). This means clicking on a username www.example.com/slavesite/user/1 redirects automatically to www.example.com/user/1 .I would appreciate some help

smartsystems160’s picture

Hello, i am still yet to resolve this issue so i thought to make it simpler to avoid wasting someone's time.

I want my slave site users to access their user profiles on the master site, while doing other things normally on the slave site, like posting blog entries, forum topics etc. that is, when a user clicks on www.master.com/slave1/user/5, the user is redirected to www.master.com/user/5. The idea behind this is to ease up load on my main site and split some projects or modules like forums, blogs, storm project management etc into separate installations

I want a redirect rule on slave site that says, redirect user/x   to   www.example.com/user/x

Help is appreciated guys.

dydave’s picture

Hi @itpromanager,

I'm really not sure if this may help, since I've never built the architecture you described before, which seems pretty advanced, but in general, if you would like to setup automatic redirects in Drupal, I thought it would be worth mentioning the Global Redirect module.
I suppose you could install Global Redirect on the slave site and configure specific redirection rules for the users profiles.

I haven't looked any further than that at the issue, but would hope this module could help you overcome this obstacle.

Thanks to all in advance for your feedbacks, comments, ideas or questions.
Cheers!

smartsystems160’s picture

Thanks for your suggestion, I've looked at the Global redirect module but I haven't tried it yet, I'll post my findings here.

UPDATE: I tried Global Redirect module but it does not profer the solution, it just does specific redirects as per the ones mentioned on the project page, no extra boxes for custom redirects.

smartsystems160’s picture

When i try the following code, it redirects only the admin user from www.example.com/slave/users/admin to www.example.com/users/admin

RewriteRule ^users/admin$ http://example.com/users/admin [R=301,L]

I'm wondering how i can configure it to redirect all other users too (i cant enter the code manually for all the usernames that will signup on the site). I believe some php could do the trick, i'm wondering what i can pass to the users/(name) side to that it can redirect every other user as well, some help needed. Thanks.

UPDATE: This code also works for the admin user (ie user 1):

RewriteRule ^user/1$ http://example.com/user/1 [R=301,L]