Forum

Simple Rewrite Rule

Guerreiro
16 July 2012, 10:27
Dear Esteemed Hiawatha guru's,

I have configured Hiawatha just right, but I want to implement one simple Rewrite rule and add it to the habari toolkit.

It is for the RSS feeds which are standard located at http://url/atom/1. If you type in http://url/atom you get a file atom popup or just an error.

So I typed
Match ^/atom Rewrite /atom/1 

That failed to work. Could anybody here please help me out with the Rewrite rule?

Thanking you all in advance.

Yours sincerely,
Guerreiro

Hiawatha version: 8.4
Operating System: Debian Squeeze
Hugo Leisink
16 July 2012, 10:45
You probably want to match /atom and /atom only. Try this one:
Match ^/atom$ Rewrite /atom/1 
Guerreiro
16 July 2012, 11:43
Still does not work sadly enough. I do not know why, but I think this has something to do with it:

application/atomsvc+xml

That comes up when you load the http://url/atom .

Also thank you for the quick response.
Hugo Leisink
20 July 2012, 09:47
With the 'application/atomsvc+xml', you mean you get a download popup for a file with that mimetype? If that's the case, that has nothing to do with the rewrite rule being correct or incorrect. It's the application that defines the mimetype.
Guerreiro
24 July 2012, 15:40
First off, did you change the forum? It looks awesome.

Yeah I get a download pop up. But when I do site/atom/1 I get a page.

What application defines the mime type? Browser?
Hugo Leisink
24 July 2012, 19:01
Yes, I was tired with the old layout. Glad you like it!

For static files, Hiawatha sets the mimetype based on the extension.
For CGI's, the mimetype is set by the CGI itself.

I'm afraid that this is an CGI application issue, not a Hiawatha issue. Because I have now idea how your CGI application works, it's hard for me to tell what goes wrong.
Guerreiro
25 July 2012, 11:42
Ok so I need to fix this with CGI That is an answer as well. Thanks a lot for the help.

Also thank you for making hiawatha server, it is the only one I could easily configure and get working straight away.

Woot. Have a nice day. This ticket can be marked solved.
This topic has been closed.