Forum Moderators: phranque
Firstly, I am a new member, but this doesn't mean that I didn't have already searched for my problem. As I run a forum myself, I am well aware of the fact that it is annoying to read the same questions again and again. So please excuse me, if this very problem of mine had already been addressed, but I can't seem to find a solution that's already been posted.
I run a website located at http://www.example.org . I own several other domains (~20 of them) that also point to my website, and some 4 or 5 of them are also directly associated with my webspace, while the others are usual redirect.
As cookies only work on the website that issued them, it is necessary to have all these domains consolidated into the main URL http://www.example.org . That's the mod_rewrite rules I am running right now:
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.example\.org$ [NC]
RewriteRule (.*) http://www.example.org/$1
RewriteBase /cgi-bin/
RewriteRule ^index\.html forum.pl [L]
RewriteRule ^forum([0-9]+)/([0-9]+)\.html$ forum.pl?f=$1&m=$2 [L]
RewriteRule ^forum([0-9]+) forum.pl?f=$1 [L]
RewriteRule ^area([0-9]+) forum.pl?tb=$1 [L]
errorDocument 404 http://www.example.org
errorDocument 403 http://www.example.org
It works absolutely fine, except one thing that annoys me. If one enters http://example.org, he'll get a 500. I really don't know why, because without the rules it works, and even http://example.net gets correctly rewritten. To make myself clearer (I am not an English native speaker), some examples how it should work:
http://www.example.net/forum1/29356.html
http://www.example.org/forum1/29356.html
(and others)
should be rewritten to:
http://www.example.org/forum1/29356.html
what itself gets rewritten to:
http://www.example.org/cgi-bin/forum.pl?f=1&m=29356
The above works perfectly fine. The same is true for
http://example.net/forum1/29356.html
or http://example.net/forum1/29356.html
or even http://example.org/forum1/29356.html
but: if one enters
http://example.org/forum1/29356.html
he gets a 500.
Why is this? I am really totally fed up with this #*$! right now. If would really appreciate anybody pointing me to the right direction.
Thanks, Oliver.
[edited by: jdMorgan at 7:48 pm (utc) on Mar. 12, 2006]
[edit reason] No URLs, please. See Terms of Service. [/edit]
The above works perfectly fine. The same is true for
http://example.net/forum1/29356.html
or [ex-ample.net...]
or even [ex-ample.org...]
Please disregard this paragraph in the original posting.
errorDocument 404 http://www.example.org
errorDocument 403 http://www.example.org
errorDocument 404 /
errorDocument 403 /
For best results, each error should be handled with a custom page explaining the error and containing a text link to the home page, and optionally -- a 5-second or greater meta-refresh to the home page.
If you get a 500-Server Error, the first place to look is in your server error log. It will often tell you exactly what is wrong.
Jim