As part of trying to make an AJAX site crawlable, I wish to redirect URLs containing "_escaped_fragment_" to Tomcat.
I currently make Apache serve the root resource "/" but if the resource "/?_escaped_fragment_=" is requested then it should redirect the request to Tomcat so that the crawler servlet can service it.
It seems to me that you can not do that in mod_jk.conf
You could use an Apache rewrite rule to transform the URL in a format that will be easier to forward to Tomcat using mod_jk:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^(_escaped_fragment_=.*)
RewriteRule ^/$ /crawler/?%1 [L,R=permanent]
The above rule would only apply when the query string starts with _escaped_fragment_=
and it will transform this URL:
http://host/?_escaped_fragment_=home
Into this one:
http://host/crawler/?_escaped_fragment_=home
You can then use the usual JkMount directive to forward /crawler
to Tomcat, e.g.:
JkMount /crawler* ajp13_worker
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments