I have a file that relies on a self-executing anonymous Javascript/JQuery function to make the page's content appear. When I load the file directly, like this:
mysite/x.html
...then the page loads and everything displays. However, if I use even the simplest RewriteRule to fetch it without changing the URL, like this:
- Code: Select all
RewriteRule ^g$ /x.html [NC,L]
...then the code is served to the browser when I enter:
- Code: Select all
mysite/g
...(viewing the source confirms this) but the self-executing anonymous script function does not execute, and so only a blank page appears in the browser (there are no PHP errors, etc.; I've checked all of the logs).
However, appending an R flag to the RewriteRule, like this:
RewriteRule ^g$ /x.html [NC,L,R]
...allows the page to execute. The problem, however, is that "X.HTML" now appears in the URL bar; I want the "G" to remain in the URL bar.
How do I force MOD_REWRITE to allow self-executing anonymous functions to execute when the page is gotten by internal redirection?