View Full Version : Quercus on Glassfish with URL Rewriting

07-09-2010, 06:49 PM
I have Glassfish 3 server and trying to implement Quercus on it. Everything works perfectly with 4.0.7 version. Now I'm trying to run Question2Answer (http://question2answer.org/) application on my server. I was able to open application but it's not allowing me to navigate from page to page because they are using .htaccess file to rewrite the URL. I was wondering how do we rewrite the URL in this case?

Here is what Question2Answer's .htaccess has inside:

DirectoryIndex index.php
RewriteEngine On
#RewriteBase /your-sub-directory
RewriteCond %{REQUEST_URI} ^(.*)//(.*)$
RewriteRule . %1/%2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ index.php?qa-rewrite=$0&%{QUERY_STRING} [L]

Do you have any solutions for that?

07-09-2010, 09:23 PM

I'm not sure on Glassfish -- it's a straightforward translation in Resin, though. For Glassfish, you could use UrlRewriteFilter or put Apache in front. If my mod_rewrite descrambling skills are still working ;), I think that it's just removing extraneous double slashes in the middle of URLs (though it looks like it's removing at most one instance) and rewriting paths not backed by actual files into index.php, which is serving as a controller.