[TYPO3-english] Disable RealURL for specific URL

Olivier Seubert olizzs at yahoo.de
Sun Mar 22 16:25:18 CET 2015

Hello smart people,

(this is a cross-post from the German forum, hoping to find a solution and not to offend anybody by it)

I'm looking for a brilliant idea :-) !!!

Version: typo3 6.2 LTS

The folowing impasse: I would like to write an extension, that checks if a frontend user is allowed to see a file, before it is displayed. These were my thoughts:

1. Each HTTP request in a specific folder is rewritten to a specific typo3 pageType 665 via .htaccess:
htaccess in folder fileadmin/internal: RewriteRule ^(.*)$ /index.php?type=665&tx_internalfiles_mapper[file]=$1 [L]

2. The pageType 665 is configured to embed the extension plugin, which checks if the frontend user is allowed to see the file and which returns the file's content if he is:
tx_internalfiles_mapper = PAGE
tx_internalfiles_mapper {
typeNum = 665
10 <tt_content.list.20.internalfiles_mapper

Without RealUrl everything works like a charm.

However if RealURL is installed, there are problems:
Then, instead of recognizing the pageType 665, typo3 calls RealURL which tries to resolve /fileadmin/intern/testdatei.png. This of course won't be found so that the request is redirected to the 404 Not-Found-page. I would like to prevent RealURL from interfering.

If I change the internal Rewrite in the .htaccess (see above) to an external Redirect [R], it works again. However this is not so nice, because the Redirect-URLs of course become very cryptic. I really would like to solve it via internal Rewrites

My questions:
1. Is there a way to bypass RealURL, e.g. via a URL parameter &tx_realurl[enable]=0?
2. Can I deactivate RealURL for a specific path (fileadmin/internal) inside typo3?
3. Is there another brilliant way to prevent RealURL from interfering?
4. Am I reinventing the wheel? Is there maybe already an implementation, which checks the file's metadata for frontend user group restrictions  and if so if the user is logged in correctly before displaying it?

I'd be very happy for any flash of genious/inspiring idea ;-).



More information about the TYPO3-english mailing list