[TYPO3] RealURL ignores mod_rewrite internal redirects?

Christian Vetter Christian.Vetter at dragoner-design.de
Sat Apr 15 18:01:46 CEST 2006


Hi Joe,

Am 15.04.2006, 02:01 Uhr, schrieb Joseph Mesterhazy <jmesterh at iastate.edu>:

> Hello Typo3 gurus,
You don't really need a guru here, so I guess I'll help instead ;)

> I have a working Apache+Typo3 3.8 setup, with realurl installed. I
> would like to use mod_rewrite to internally redirect specific urls,
> but realurl seems to override my internal redirects. For example, I
> have this in my .htaccess in the root of the Typo3 install:
>
> RewriteRule person/([a-z].*) index.php?id=1931&netid=$1 [L]
>
> What this does is internally redirect any URLs of the form 'person/
> somestring' to 'index.php?id=1931&netid=somestring'.  However,
> realurl is thinking that 'person/somestring' is a page path, and it
> doesn't find it, so the page redirects to a 404.
Correct - that's how realUrl works.

> I do know the internal redirect is working, because if I put this at
> the very top of index.php in the Typo3 site root, the redirects
> suddenly work:
>
> if (ereg('person/', $_SERVER['REQUEST_URI'])) {
>          $_SERVER['REQUEST_URI'] = '';
> }
Of course, because you suddenly take the working ground of realUrl away.

> Apparently, if $REQUEST_URI has a value, then realurl attempts to
> find that path, instead of using the specific page ID in
> $QUERY_STRING (id=1931&netid=somestring).
As said above, that's how realUrl is meant to work.

> Like many things in Typo3, there is probably an obvious solution to
> this problem, but right now I have no idea what it could be.
Well, look some lines above - there you can see it ;)

> Can anyone help point me in the right direction?
Upward from here ;)
Or you might want to go the way of configuring the realUrl extension, like  
so (untested, and in addition to your current configuration):
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
	'postVarSets' => array(
		'_DEFAULT' => array (
			'person' => array(
				array(
					'GETvar' => 'netid',
				),
			),
		),
	),
);

You might want to read the realurl documentation ;)

Best regards,
Christian



More information about the TYPO3-english mailing list