I am running Nginx 1.5.6 and I use the Simple Machines Forum software. Most rewrite rules seem to work properly, with the exception of the RSS feeds.
In my Nginx configuration, I have the following line which is supposed to handle URLs which contain ".xml":
rewrite ^/forum/(\.xml|xmlhttp)/?$ "/forum/index.php?pretty;action=$1" last;
The above rule produces the following URL for the main forum, which returns a 403 Error: http://www.mydomain.com/forum/.xml/?type=rss
I would like the rewrite rule to produce this type of URL, which returns code 200 (a real page): http://www.mydomain.com/forum/?type=rss;action=.xml
Here is the entire block pertaining to the forum rewrites: http://pastebin.com/raw.php?i=tZkAibW3
I would really appreciate some help to create a rewrite rule to do that. Thanks.
You can't include the query string in your
rewrite
clause (this would require amap
orif
). How about something like the following?Your users could access your feed directly via http://mydomain.com/forum/rss.xml
Well, Simple Machines is a terrible mess, but there is simply not a single good forum software out there (was always thinking about starting my own open source project for this task).
Please try the following (correcting your evil
if
usage):