-2

I need to write a .htaccess rewrite command to make a certain URL behave like another.

A forum module I have installed over ExpressionEngine will not work unless the forum is situated on the first segment of the URL.

So I need to make: www.example.com/members/forum/

behave like: www.example.com/forum/

Cœur
  • 37,241
  • 25
  • 195
  • 267
digiwig
  • 621
  • 1
  • 9
  • 21
  • on Apache or IIS? If Apache I can help. – Olivier Pons Nov 30 '11 at 11:54
  • Why don't you just [change the forum URL](http://stackoverflow.com/a/8272421/245264) to `/members/forum/` and [run the forum thru regular templates](http://expressionengine.com/user_guide/modules/forum/other_features.html#running-the-forums-through-regular-templates)? No `mod_rewrite` rules needed. – rjb Dec 02 '11 at 18:48

2 Answers2

1
RewriteEngine on
RewriteRule ^(forum/.*)$ /members/$1
Gerben
  • 16,747
  • 6
  • 37
  • 56
  • This RewriteRule will work, but unless the ExpressionEngine Discussion Forum settings are updated, the links will still be written out as `/members/forum/viewthread/1/` – rjb Dec 02 '11 at 18:45
1

Change your Forum URL to /members/forum and run the forum thru regular templates — no mod_rewrite rules needed.

Follow these detailed instructions:

  1. Create a new template group: members
  2. Within that template group, create a new template: forum
  3. In the forum template, put the following code: {exp:forum}
  4. From the Control Panel, go to Add-Ons > Modules > Discussion Forum > Default Preferences
  5. Configure your Forum Board Preferences to the following:

Forum Forum Board Short Name: forum
Forum URL: http://example.com/index.php/members/forum
Forum Triggering Word: <empty>

At this point, your forum will then be run inside the regular EE templating engine.

The forum is then accessed through whichever template you created above — the template name used in place of the "trigger" word:

http://www.example.com/members/forum/

Your links will then be written out using the Forum URL specified in the Control Panel.

Community
  • 1
  • 1
rjb
  • 9,036
  • 2
  • 44
  • 49