Actions
Bug #59037
closedSet of TYPO3_CONTEXT in .htaccess throws internal server error
Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-05-22
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
We had a weird behavior of htaccess, caused by default _.htaccess of TYPO3 on Apache servers.
When you call: http://domain.com/fileadmin/second/third
You get an internal server error if the file/dir is not existing.
When you call: http://domain.com/fileadmin/second
You get a 404 error, as expected.
The reason is the combination of:
# Rules to set ApplicationContext based on hostname #RewriteCond %{HTTP_HOST} ^dev\.example\.com$ #RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Development] #RewriteCond %{HTTP_HOST} ^staging\.example\.com$ #RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Production/Staging] #RewriteCond %{HTTP_HOST} ^www\.example\.com$ #RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Production]and
RewriteRule ^(typo3/|fileadmin/|typo3conf/|typo3temp/|uploads/|favicon\.ico) - [L]
We also figured out a simple fix, just replace
#RewriteRule (.*) $1 [E=TYPO3_CONTEXT:Development]with
#RewriteRule (.*) - [E=TYPO3_CONTEXT:Development]and repeat it for the other contexts.
Actions