[FLOW3-general] Blog example and images.
"Christian Müller (FLOW3 Team)"
christian.mueller at typo3.org
Fri Aug 24 09:15:53 CEST 2012
Hi Mario,
those two Rules from the .htaccess are responsible for rewriting
resource URLs:
# Perform rewriting of persistent private resources
RewriteRule
^(_Resources/Persistent/[a-z0-9]+/(.+/)?[a-f0-9]{40})/.+(\..+) $1$3 [L]
# Perform rewriting of persitent resource files
RewriteRule ^(_Resources/Persistent/.{40})/.+(\..+) $1$2 [L]
What they do is basically take the beginning of the URI up to the hash
and the file extension and strip out everything in between. So with this
rules if you request:
http://localhost/flow3/Web/_Resources/Persistent/1f7cbb751abf9b54fc31ffc176e7da8ae666e8f7/myFile.jpeg
It would end up at
http://localhost/flow3/Web/_Resources/Persistent/1f7cbb751abf9b54fc31ffc176e7da8ae666e8f7.jpeg
Which in turn should be the correct path for your resource. How do your
"normal" action URLs look like? do they contain index.php? That is a
clear sign that rewriting isn't turned on. But if in such a case the
resource URIs still point to the "nice" rewritten URI this would be a bug.
Cheers,
Christian
On 23/08/12 14:49, mario chiari wrote:
> Hi
>
> thanks for your reply.
> I am sorry I did not explain myself.
>
> In the post/show.html template we have:
>
> <f:if condition="{post.image.originalResource}">
> <p><img src="{f:uri.resource(resource: post.image.originalResource)}"
> style="max-width: 100%" alt="{post.image.title}" /></p>
> </f:if>
>
> It renders, for a given post and a img myFile.jpeg therein, as
>
> <p><img
> src="http://localhost/flow3/Web/_Resources/Persistent/1f7cbb751abf9b54fc31ffc176e7da8ae666e8f7/myFile.jpeg" style="max-width: 100%" alt="My image title" /></p>
>
> (note 1f7cbb751abf9b54fc31ffc176e7da8ae666e8f7 is a subfolder, not a
> file name.)
>
> Instead, FLOW3 seems to upload myFile.jpeg as
> flow3/Web/_Resources/Persistent/1f7cbb751abf9b54fc31ffc176e7da8ae666e8f7.jpeg
> (no subfolder, original file name is gone)
>
> I do see flow3/Web/.htaccess and had set:
> SetEnv FLOW3_ROOTPATH /var/www/html/flow3/.
>
> I am not so familiar with rewrite rules, which one could be needed, if
> any?
>
> Thanks
> Best wishes
> mario
>
>
>
>
>
> On Thu, 2012-08-23 at 00:18 +0200, "Christian Müller (FLOW3 Team)"
> wrote:
>> Hi,
>>
>> I somehow don't understand the problem from the text, because everything
>> you describe should be correct and working. Have a look at the default
>> .htaccess file delivered with the FLOW3 distribution, you should find a
>> rewrite rule for this kind of resource URIs, but maybe it is not used on
>> your system?
>>
>> Cheers,
>> Christian
>>
>> On 22/08/12 13:09, mario chiari wrote:
>>> Hello
>>>
>>> I need help on the following, about the Blog package.
>>>
>>> If I try to insert a image <myfile>.jpg into a post, the following
>>> happens:
>>>
>>> -- image is uploaded to folder ../flow3/Data/Persistent/Resources as
>>> something like 3b....fe5;
>>> -- a link 3b....fe5.jpg to above is created within
>>> flow3/Web/_Resources/Persistent,
>>> -- action post/show renders img link
>>> as /flow3/Web/_Resources/Persistent/3b....fe5/<myfile>.jpg, and so image
>>> is not displayed on the FE.
>>>
>>> A (minor) bug or I did something wrong?
>>> Help welcome
>>> Thanks
>>> mario
>>>
>>>
>>>
>>
>> _______________________________________________
>> FLOW3-general mailing list
>> FLOW3-general at lists.typo3.org
>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow3-general
>
>
More information about the FLOW3-general
mailing list