1

I have the same problem as this thread: Why can't I post topics on a Forum?

Disabling the htaccess file works, but then I have index.php back in all my urls. Any idea of the cause of this and a better fix?

Edit to add, I've pin-pointed the problem to the removal of trailing slashes using this htaccess code:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ /$1 [R=301,L]

Removing that chunk makes it work ok, but it'd be nice to remove the trailing slashes on the forum urls.

  • How much do you have going on in your htaccess file? Sounds like that may be the problem here as it all works without it so I'd try and pinpoint exactly what's causing the problem. You may need to post your htaccess file here for people to be able to help more though. – Mark Bowen Sep 8 '14 at 15:46
  • Thanks Mark, yes I've pinpointed the problem now to the removal of trailing slashes: – James Smith Sep 8 '14 at 15:47
  • EDIT : I'll post this as an answer instead as totally forgot there are no line-breaks in comments. Could you try this code and see if it works for you? You'll need to edit it slightly to reflect your host though RewriteCond %{HTTP_HOST} !^\.yoursite\.com$ [NC] RewriteRule ^(.+)/$ http://%{HTTP_HOST}/$1 [R=301,L] – Mark Bowen Sep 8 '14 at 15:53
  • Actually I thought that in version 2 they'd taken out trailing slashes anyway? May be wrong on that though as my memory isn't quite what it used to be. – Mark Bowen Sep 8 '14 at 15:58
  • They removed trailing slashes in EE2 yep, but looks like that didn't make it into the Discussion Forum module! – James Smith Sep 8 '14 at 21:57
0

Could you try this code instead.

RewriteCond %{HTTP_HOST} !^.yoursite.com$ [NC]

RewriteRule ^(.+)/$ http://{HTTP_HOST}/$1 [R=301,L]

You can place the code above on just two lines if you like but for some reason when I line break the code here it's placing it all back on one line again!! Grrr! :-(

| improve this answer | |
  • thanks Mark. Your code removes the trailing slashes the same as mine, but the same problem prevails, unable to post topics with that in place. – James Smith Sep 8 '14 at 16:37
  • Should have mentioned that I ' think' you'll need to make sure that the above code goes before any which is removing index.php Might be an idea to try that. Hope that helps. – Mark Bowen Sep 8 '14 at 16:42
  • still the same having it before the index.php removal – James Smith Sep 8 '14 at 21:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.