[FLOW3-general] Blog example and images.

mario chiari m at mariochiari.net
Fri Aug 24 13:19:31 CEST 2012


Hi Christian,

thanks for your nice primer, but I am not able to make it.

See my /var/www/html/flow3/Web/.htaccess file below. It should be ok,
isn't it?

My /var/log/httpd/error_log file shows:

[Fri Aug 24 13:11:48 2012] [error] [client 127.0.0.1] File does not
exist: /var/www/html/flow3/Web/_Resources/Persistent/0c800870e05ccf739915323406587e4587d9a13a, referer: http://localhost/flow3/Web/index.php/typo3.blog/post/show?post%5B__identity%5D=6af7e19a-8aeb-4a58-9c61-7ca4407e2276


moreover

[root at localhost Persistent]# ls -l
total 16
lrwxrwxrwx 1 apache apache 86 Aug 24 13:11
0c800870e05ccf739915323406587e4587d9a13a.jpeg
-> /var/www/html/flow3/Data/Persistent/Resources/0c800870e05ccf739915323406587e4587d9a13a


[root at localhost Resources]# ls -l
total 1656
-rw-r--r-- 1 apache apache 492849 Aug 24 13:11
0c800870e05ccf739915323406587e4587d9a13a

do you see anything wrong?
Danke!

mario


--------------------------------------------
/var/www/html/flow3/Web/.htaccess

#
# FLOW3 context setting
#

# You can specify a default context by activating this option:
SetEnv FLOW3_CONTEXT Production

# If the root path is not the parent of the Web directory, FLOW3's root
path must be
# specified manually:
SetEnv FLOW3_ROOTPATH /var/www/html/flow3/  # by mario

#
# mod_rewrite configuration
#
<IfModule mod_rewrite.c>

	# Enable URL rewriting
	RewriteEngine On

	# Set flag so we know URL rewriting is available
	SetEnv FLOW3_REWRITEURLS 1

	# You will have to change the path in the following option if you
	# experience problems while your installation is located in a
subdirectory
	# of the website root.
	RewriteBase /flow3/ # by mario

	# Stop rewrite processing no matter if a package resource, robots.txt
etc. exists or not
	RewriteRule ^(_Resources/Packages/|robots\.txt|favicon\.ico) - [L]

	# Stop rewrite process if the path points to a static file anyway
	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -l [OR]
	RewriteCond %{REQUEST_FILENAME} -d 
	RewriteRule .* - [L]

	# 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]

	# Make sure that not existing resources don't execute FLOW3
	RewriteRule ^_Resources/.* - [L]

	# Continue only if the file/symlink/directory does not exist
	RewriteRule (.*) index.php

</IfModule>

<IfModule mod_negotiation.c>

	# prevents Apache's automatic file negotiation, it breaks resource URLs
	Options -MultiViews

</IfModule>

<IfModule mod_setenvif.c>

	# Redirect authorization header when PHP is running as CGI
	SetEnvIfNoCase Authorization "Basic ([a-zA-Z0-9\+/=]+)"
REMOTE_AUTHORIZATION=$1

</IfModule>

ErrorDocument 500 "<h1>Application Error</h1><p>The FLOW3 application
could not be launched.</p>"

---------------------------------------------



On Fri, 2012-08-24 at 09:15 +0200, "Christian Müller (FLOW3 Team)"
wrote:
> 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
> 
....



More information about the FLOW3-general mailing list