x
 
Create New Page
 View Previous Changes    ( Last updated by Derek Jones )

Force Member Pages through the Forum Module

The Discussion Forum module uses the Member module to render its profile pages, and allows for a user’s selected theme to apply to the member profile area as well for a consistent experience.  However, the Member module does not have the user theme-switching flexibility that the Discussion Forum has.  So it may be desirable if you are running the forum module to route all requests for the Member module’s profile pages to the forum, circumventing the need to modify the Member module themes as well as allowing you to keep a single URL structure for member pages.

You can use .htaccess to accomplish this on most servers, by adding the following:

# Redirect /member/ to /forums/member/
RewriteCond %{REQUEST_URI} ^/index.php/member
RewriteRule
^index.php/(.*)$ http://example.com/index.php/forums/$1 [L,R=Permanent]

The reason for using a full URL in the RewriteRule is so that the request is actually redirected and not just rewritten.  That way the user sees the desired URL in their address bar.  If you are removing index.php from your URLs, you can use the following, but make sure to place it above your index.php removal code in your .htaccess file.

# Redirect /member/ to /forums/member/
RewriteCond %{REQUEST_URI} ^/member
RewriteRule
^(.*)$ http://example.com/forums/$1 [L,R=Permanent]