Skip to content

RedirectModule

Hamed Abdollahpour edited this page Sep 19, 2013 · 1 revision

With redirect module you can redirect to specific URL with with specific pattern. You can also add some parameters from requested URL to destination URL. Redirect syntax is exatly like Rewrite syntax in RewriteModule

Example1:

<module>
	<name>redirect</name>
	<author>Hamed Abdollahpour</author>
	<class>ir.xweb.modules.RedirectModule</class>
	<properties>
		<property key="/" value="/en/index.html" />
		<!-- You need to add default.user as system property. So, you can use it in different module in your application -->
		<!-- If you wanna use property or System Enviroment variables, you should put the value ass inner text and not value attribute -->
		<property key="download/(.*)">/api?id=${default.user}&file=</property>
	</properties>
</module>
  • Remeber that you should load redirect module at the top of the other modules (at least GzipModuile, ResourceModule and RewriteModule)
Clone this wiki locally