[TYPO3-core] Making Real URL work for IIS
Martin Kutschker
Martin.Kutschker at n0spam-blackbox.net
Thu Jan 4 14:49:08 CET 2007
Hi!
For IIS there exist several mod_rewrite equivalents. I have tested two of
them: ISAPI_rewrite (free "lite" version) [1] and mod_rewrite (GPL) [2].
Both have one in common: They change REQUEST_URI, so Real URL breaks. But
there is a solution to it.
As ISAPI_rewrite sets HTTP_X_REWRITE_URL to the original value of
REQUEST_URI we can reload it with the old value (see [3] for a success
story). mod_rewrite does no such thing, but the original URL can be
preserved as query argument.
The docs of IIS Rewrite [4] says it sets HTTP_SCRIPT_URL, but I haven't
verified [yet] it as it costs money (free trial is possible). If it doesn't
work the query argument trick should work here too. But there is a entry in
the bugtracker [4] which uses it though the author fails to tell that he is
using IIS Rewrite (but HTTP_SCRIPT_URL isn't set by IIS itself)
So to make use of these I suggest, we add a configuration setting from
which global variable REQUEST_URI is to retrieve:
case 'REQUEST_URI':
if ($GLOBALS['TYPO3_CONF_VAR']['SYS']['requestURI']) {
list($v,$n) = split('|',$GLOBALS['TYPO3_CONF_VAR']['SYS']['requestURI']);
$retVal = $GLOBALS[$v][$n];
} elseif (!$_SERVER['REQUEST_URI']) {
...
}
For ISAP_rewrite you have to use _SERVER|HTTP_X_REWRITE_URL etc
If someone wants to play with it I can provide sample configurations.
Anyway, what do you think?
Masi
[1]
http://www.isapirewrite.com/
http://www.helicontech.com/
[2]
http://www.iismods.com/
[3]
http://wiki.typo3.org/index.php/Windows#ISAPI_Rewrite
[4]
http://www.qwerksoft.com/products/iisrewrite/
[5]
http://bugs.typo3.org/view.php?id=541#3173
More information about the TYPO3-team-core
mailing list