Forum Moderators: phranque
I'm new to this whole mod_rewrite thing.
I'm trying to create a system that allows multiple forums, but it isn't working out as planned.
I have a problem with the trailing slash resulting in a 404 error.
e.g. : [example.be...]
but [example.be...] works fine
the code i use is :
Options Indexes FollowSymLinks MultiViews All
RewriteEngine On
RewriteRule ^forums/(.*)/phpbb(.*) /forums/phpbb/$2
Any help would be nice :)
[edited by: jdMorgan at 5:26 pm (utc) on Dec. 29, 2004]
[edit reason] Removed specifics per TOS. [/edit]
Welcome to WebmasterWorld!
Your Options settings are inconsistent... I'd suggest you look up each Option [httpd.apache.org] and make sure you need it. If you don't need MultiViews for content negotiation, turn it off, as it can cause this problem. Otherwise, "Options All" covers the rest of them.
I can't suggest changes to the code because I don't understand all the details of your site layout. You might want to explain the code you have (in detail) and what you hope to accomplish with it. For example, what is the "1" between "/forums/" and "/phpbb"? Is it always present? What values might it have other than "1"? Why do you test for it, and why do you discard it if present? If you want a precise answer, then these questions need to be addressed.
Jim
the real url of the forum is : [example.be...]
That 1 is meant to change, I'm trying to setup a free forum hosting service.
Basicly i just want that it rewrites it to the normal forum. And with php i can read the number (in this case 1).
Hope this is enough.
[edited by: jdMorgan at 5:23 pm (utc) on Dec. 29, 2004]
[edit reason] Removed specifics per TOS [/edit]
RewriteRule ^forums/(.*)/phpbb/(.*) /forums/phpbb/$2 RewriteRule ^forums/(.*)/phpbb/?(.*) /forums/phpbb/$2 [edited by: jdMorgan at 5:24 pm (utc) on Dec. 29, 2004]
[edit reason] Removed specifics per TOS. [/edit]
RewriteCond %{REQUEST_URI} !\.(gif¦jpe?g¦png)$
RewriteRule ^forums/(.+/)?phpbb/?(.*) /forums/phpbb/$2 [L]
Note that the broken pipe "¦" characters above will need to be replaced with solid pipes from your keyboard before use. Posting on this board modifies those characters.
Jim