HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Server Operation (
-   -   Apache directives & front controller pattern (

centurianii 5th February 2013 02:08

Apache directives & front controller pattern
I'm wondering what directives to write to my apache 2 virtual hosts so as to start using a design based on the front controller pattern.

To be more precise, my ajax requests would update the url hash fragment resulting in urls shown to user as:
containing links of the form:

<a id="123" href="/#!/path/to/data&ui=123&var=456&id=2714">link</a>
or using the Hijax technique:

<a id="123" href="index.php?/path/to/data&ui=123&var=456&id=2714">link</a>
(javascript handles all behavior of links)

But as google instructs here the crawler will make the following request TO the server:
or using the Hijax technique (nothing new here):
and the server SHOULD map these back to their ajax form plus a snapshot of the page!

As you can see, one immediate solution comes from the front controller pattern: send all external requests of the form:
and also force the user to see the new ajax version:
How can I do such generalized redirection in apache2?


falko 5th February 2013 21:19

I guess something like this should work:


  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^ index.php [L]

All times are GMT +2. The time now is 03:37.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.