[TYPO3-english] Rewrite and siteScript

Pero Matic takoje at takoje.hr
Fri Oct 22 10:23:28 CEST 2010


I finaly solved this. The problem is with $_SERVER['REQUEST_URI'] which is 
used as siteScript var which is used in CoolURI as uri var. When u make 
internal apache rewrite ie.

RewriteRule ^/page1(.*)$ /page1/page2/page3/page4$1

and u want to access page in url /page1/page2/page3/page4/page5 by writting 
/page1/page5

 $_SERVER['REQUEST_URI']  = /page1/page5

which is not good in this case.

So i made rewrite rule like this:

RewriteRule ^/page1(.*)$ - [E=REQUEST_URI:/page1/page2/page3/page4$1]

One should think that this would overwrite "real" $_SERVER['REQUEST_URI'] 
but it will not - why make it simple. This will create new $_SERVER var 
called $_SERVER['REDIRECT_REQUEST_URI'] which can be used in CoolURI 
something like this:

if (!empty($_SERVER['REDIRECT_REQUEST_URI']))
  $paramsinurl = $_SERVER['REDIRECT_REQUEST_URI'];

Regards.




More information about the TYPO3-english mailing list