[Plugin: WP Super Cache] still not corrected… bug about unicode-range letters in permalink
-
see: https://www.ads-software.com/support/topic/262117?replies=9
once i have looked new code about this fix, now there is other code…
now i have enabled super cache and see that this still or again (i have not tested versions between these) do not work in the new version.function get_current_url_supercache_dir is in wp-cache-phase1.php now.
i think now may be you donncha have not corrected this because may be this fix (adding urldecode) produces filenames with unicode letters? and such filenames are not supported on many hosts? what happen if not supported… i think just one-byte view of unicode appear… and it anyway do not work… so, why you have not included this fix in official/repository code?
in new version i think fix is may be same, but surround “$uri” with urldecode:
$uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '/index.php', '/', str_replace( '..', '', preg_replace("/(\?.*)?$/", '', urldecode($uri) ) ) ) );
-
what i have said in the previous post here is wrong, it is modified, gzipped file serving is added.
how donncha has made serving gzipped file in the “last chance” section for now in development version:
if ( file_exists( $file . ".gz" ) && $wp_cache_gzip_encoding ) { header( 'Content-Encoding: ' . $wp_cache_gzip_encoding ); header( 'Content-Length: ' . filesize( $file . ".gz" ) ); readfile( $file . ".gz" ); } else { readfile( $file ); }
why not checked whether gzip is accepted by browser? just because this is development version? or because most browsers support gzip?
i have made this code in this place:if(function_exists('apache_request_headers')){ $caqorow=apache_request_headers(); $tigindegi=$caqorow['If-Modified-Since']; if(strpos($caqorow['Accept-Encoding'],'gzip')!==FALSE){$gzipqabul=true;} }else{ $tigindegi=$_SERVER['HTTP_IF_MODIFIED_SINCE']; if(strpos($_SERVER['HTTP_ACCEPT-ENCODING'],'gzip')!==FALSE){$gzipqabul=true;} } if ( file_exists( $file . '.gz' ) && $wp_cache_gzip_encoding && $gzipqabul ) { header( 'Content-Encoding: ' . $wp_cache_gzip_encoding ); header( 'Content-Length: ' . filesize( $file . '.gz' ) ); $file = $file . '.gz'; } $mondago=gmdate("D, d M Y H:i:s",filemtime( $file )).' GMT'; if($tigindegi==$mondago){ header("HTTP/1.0 304 Not Modified"); exit(); } header('Last-Modified:'.$mondago); readfile( $file );
improvements: this can send “not modified” header and checks “accept-encoding”.
btw i have discovered that “WP-Cache: Served supercache file from PHP” header is somehow skipped in my server when 304 status is returned.
what is at this place in current version ie version 0.9.9.3 ie latest stable version :
just
readfile( $file );
i can translate names of variables introduced by me into english, some are not translated, better name is used:
if(function_exists('apache_request_headers')){ $request=apache_request_headers(); $what_is_there=$caqorow['If-Modified-Since']; if(strpos($caqorow['Accept-Encoding'],'gzip')!==FALSE){$gzipisaccepted=true;} }else{ $what_is_there=$_SERVER['HTTP_IF_MODIFIED_SINCE']; if(strpos($_SERVER['HTTP_ACCEPT-ENCODING'],'gzip')!==FALSE){$gzipisaccepted=true;} } if ( file_exists( $file . '.gz' ) && $wp_cache_gzip_encoding && $gzipisaccepted ) { header( 'Content-Encoding: ' . $wp_cache_gzip_encoding ); header( 'Content-Length: ' . filesize( $file . '.gz' ) ); $file = $file . '.gz'; } $what_is_here=gmdate("D, d M Y H:i:s",filemtime( $file )).' GMT'; if($what_is_there==$what_is_here){ header("HTTP/1.0 304 Not Modified"); exit(); } header('Last-Modified:'.$what_is_here); readfile( $file );
i have moved this post to previous post.
moderators, please delete, if you see.The “&& $wp_cache_gzip_encoding” part is what checks if the browser supports gzip encoding.
Thanks for the 304 code, that’s really useful! The reason the “served from PHP..” message isn’t sent by your code is because it isn’t sent, you’re sending the 304 only.
i have forgotten to replace some “$caqorow” to “$request” in english version.
i think
header( 'Content-Length: ' . filesize( $file . '.gz' ) );
code should be excluded from if’s block so that it works also for ungzipped files, because only if size is sent, keep-alive works, and this is surely actual, because as i have seen, immediately after opening blog post, firefox loads next post.The reason the “served from PHP..” message isn’t sent by your code is because it isn’t sent, you’re sending the 304 only.
i have not deleted
header( "WP-Cache: Served supercache file from PHP" );
code, it runs, it is before the code that i had cited:header( "WP-Cache: Served supercache file from PHP" ); if(function_exists('apache_request_headers')){
The “&& $wp_cache_gzip_encoding” part is what checks if the browser supports gzip encoding.
OK, i have seen, understood it now.
why you have not added to “last chance” block in new version code of sending last modified time and sending not modified header? (for this case of pages with non-latin addresses, for they can be cached at browser and proxies if not modified?)
It was an oversight, but given that this version caused quite a few problems for others I’m glad it wasn’t included.
I’ll add it, but it’ll probably be a configurable option on the Advanced Settings page as I think some of the headers used caused problems on some hosts in the past ??
See this post for details. “Last Modified” caused a 500 error on Godaddy back in 2007, but I’m not sure if it’s a problem now.
I just checked in a modified version of your code. You can take it for a spin by checking out the SVN or waiting for the dev version to update in the next 15 minutes or so.
OK! i am glad. i have checked only last chance section yet. maybe “served supercache file from php” is also in another place… as i said, file size in header should be sent also in none content encoding mode, so i think,
header( 'Content-Length: ' . filesize( $file ) );
should be deleted from its current location and be written before “readfile”, ie:header( 'Content-Length: ' . filesize( $file ) ); readfile( $file );
Now I remember why Content-Length wasn’t used before – some hosts have problems with it. I might add it as part of the 304 feature.
hm i see that i had said “you are sure that B does not work?” but i do not see here that you have said that it does not work, but i remember that you have said so, maybe i have understood you wrongly.
today i again have tried, B and int:escape map both don’t work. i am going to try to start with empty rewrite rules to get a file with name like %ab .
donncha, please make option to use or not to use unescaped file names. probably most linuxes can work with them. i think most bad characters are .. and / whose behavior you probably can check.
and it’s interesting to know what is happening in windows with different characters that are not allowed in file names in ntfs with different apache distributions.
btw characters not allowed in file names in windows: https://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx#naming_conventions . info about FAT and mac os: https://support.grouplogic.com/?p=1607 . wikipedia: https://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words .hello. i have discovered several things.
[B]: it could work if it does not fail with several little reasons. it replaces slashes (“/”) to %2f. slash is used here, for example, “2011/01/25/post1”. rewrite log:127.0.0.1 - - [25/Jan/2011:17:55:03 +0300] [wp.localhost/sid#211239c8][rid#21665c30/initial] (3) [perdir /var/www/localhost/test/wpmu/] add path info postfix: /var/www/localhost/test/wpmu/2010 -> /var/www/localhost/test/wpmu/2010/10/01/ttt/ 127.0.0.1 - - [25/Jan/2011:17:55:03 +0300] [wp.localhost/sid#211239c8][rid#21665c30/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/2010/10/01/ttt/ -> 2010/10/01/ttt/ 127.0.0.1 - - [25/Jan/2011:17:55:03 +0300] [wp.localhost/sid#211239c8][rid#21665c30/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^(.*)' to uri '2010/10/01/ttt/' 127.0.0.1 - - [25/Jan/2011:17:55:03 +0300] [wp.localhost/sid#211239c8][rid#21665c30/initial] (2) [perdir /var/www/localhost/test/wpmu/] rewrite '2010/10/01/ttt/' -> '/wp-content/cache/supercache/wp.localhost/2010%2f10%2f01%2fttt%2f/index.html.gz' 127.0.0.1 - - [25/Jan/2011:17:55:03 +0300] [wp.localhost/sid#211239c8][rid#21665c30/initial] (1) [perdir /var/www/localhost/test/wpmu/] internal redirect with /wp-content/cache/supercache/wp.localhost/2010%2f10%2f01%2fttt%2f/index.html.gz [INTERNAL REDIRECT]
but i have used rewrite rules not in htaccess file, in all examples. but in <directory> tags (that are in <VirtualHost *:80> tags) in apache configuration files. (“RewriteEngine On” should be also in “<directory>” tags)
about “int:escape” built-in function i will write in next post.
offtopic:
test of post formatting:
<directory> tag
<directory> tag
<directory> tag
<directory> tag
first (line) is simply, second is with html entity “lt” instead of “less then” character, third is simply but in “code” marks (like apostrophe), 4th line is both with entity and apostrophe.add after several minutes: hm, it now creates urlencoded string with lower case hex digits, i do not know whether i have been mistaken or something has changed. i add after near 20 minutes: i have probably confused with int:escape, i have deleted what i said, it was: “second reason is it creates url code with big ABCDEF letters for hex digits, but target folder created by wordpress is with lower case digits. though probably this problem can be avoided using “int:tolower” function/rewritemap of rewriterules.”
btw i have thought about domain name, it has dots, i thought wordpress supports unicode domain names, and that they are also urlencoded, in such case [B] also changes dots to %2e, but wp does not support such domains yet, and in slugs dots are replaced to “-“(dash). btw [B] encodes also dash to %2d , and supercache also does not encode it, so for that reason it also won’t work with my current version of supercache.int:escape: it does not work because of little problem, and probably this can be fixed.
configuration:RewriteLogLevel 3 RewriteLog /var/log/apache2/rewrite.log RewriteMap esc int:escape <directory /var/www/localhost/test/wpmu/ > RewriteEngine On AllowOverride None # BEGIN WPSuperCache <IfModule mod_rewrite.c> AddDefaultCharset UTF-8 RewriteCond %{REQUEST_URI} !^.*[^/]$ .....etc RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/${esc:$1}/index.html.gz -f RewriteRule ^(.*) "/wp-content/cache/supercache/%{HTTP_HOST}/${esc:$1}/index.html.gz" [L] ....etc
(i have modified only rule for gzipped file and have turned gzipping on in supercache options.)
this does work with “ascii”(latin letters, digits…) slugs, but does not work with non-latin letters: logs:
ascii slug:127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215cc848/initial] (3) [perdir /var/www/localhost/test/wpmu/] add path info postfix: /var/www/localhost/test/wpmu/2010 -> /var/www/localhost/test/wpmu/2010/10/01/ttt/ 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215cc848/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/2010/10/01/ttt/ -> 2010/10/01/ttt/ 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215cc848/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^(.*)' to uri '2010/10/01/ttt/' 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215cc848/initial] (2) [perdir /var/www/localhost/test/wpmu/] rewrite '2010/10/01/ttt/' -> '/wp-content/cache/supercache/wp.localhost/2010/10/01/ttt//index.html.gz' 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215cc848/initial] (1) [perdir /var/www/localhost/test/wpmu/] internal redirect with /wp-content/cache/supercache/wp.localhost/2010/10/01/ttt//index.html.gz [INTERNAL REDIRECT] 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c95d0/initial/redir#1] (1) [perdir /var/www/localhost/test/wpmu/wp-content/cache/] pass through /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2010/10/01/ttt/index.html.gz
non-latin alphabet letter slug (does not work):
127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c8c98/initial] (3) [perdir /var/www/localhost/test/wpmu/] add path info postfix: /var/www/localhost/test/wpmu/2011 -> /var/www/localhost/test/wpmu/2011/01/20/?/ 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c8c98/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/2011/01/20/?/ -> 2011/01/20/?/ 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c8c98/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^(.*)' to uri '2011/01/20/?/' 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c8c98/initial] (2) [perdir /var/www/localhost/test/wpmu/] rewrite '2011/01/20/?/' -> '/wp-content/cache/supercache/wp.localhost/2011/01/20/%d3%a9//index.html.gz' 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c8c98/initial] (1) [perdir /var/www/localhost/test/wpmu/] internal redirect with /wp-content/cache/supercache/wp.localhost/2011/01/20/%d3%a9//index.html.gz [INTERNAL REDIRECT] 127.0.0.1 - - [25/Jan/2011:17:24:05 +0300] [wp.localhost/sid#21115948][rid#215c75b8/initial/redir#1] (1) [perdir /var/www/localhost/test/wpmu/wp-content/cache/] pass through /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2011/01/20/?
but before trying with wordpress i have tried this beginning with empty apache rules, and i have used rewrite rule not in “directory” tags but in upper level – in “virtualhost” tags, and it has worked: log:
::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#21557b28/initial] (2) init rewrite engine with requested uri /?/?/ ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#21557b28/initial] (3) applying pattern '^/(.*)$' to uri '/?/?/' ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#21557b28/initial] (2) rewrite '/?/?/' -> '/var/www/localhost/test/localhost/%d2%af/%d2%af/' ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#21557b28/initial] (2) local path result: /var/www/localhost/test/localhost/%d2%af/%d2%af/ ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#21557b28/initial] (1) go-ahead with /var/www/localhost/test/localhost/%d2%af/%d2%af/ [OK] ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#2155eb40/subreq] (2) init rewrite engine with requested uri /?/?/index.html ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#2155eb40/subreq] (3) applying pattern '^/(.*)$' to uri '/?/?/index.html' ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#2155eb40/subreq] (2) rewrite '/?/?/index.html' -> '/var/www/localhost/test/localhost/%d2%af/%d2%af/index.html' ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#2155eb40/subreq] (2) local path result: /var/www/localhost/test/localhost/%d2%af/%d2%af/index.html ::1 - - [25/Jan/2011:16:56:34 +0300] [localhost/sid#21182dd8][rid#2155eb40/subreq] (1) go-ahead with /var/www/localhost/test/localhost/%d2%af/%d2%af/index.html [OK]
(you can see here that slashes are handled as we need).
i have tried to move wordpress rewrite rules one level upper and it has worked! but a little problem has appeared: style file is not served. configuration:
RewriteLogLevel 3 RewriteLog /var/log/apache2/rewrite.log RewriteMap esc int:escape #<directory /var/www/localhost/test/wpmu/ > RewriteEngine On #AllowOverride None # BEGIN WPSuperCache <IfModule mod_rewrite.c> AddDefaultCharset UTF-8 RewriteCond %{REQUEST_URI} !^.*[^/]$ ...etc
(i have commented out directory tags and AllowOverride directive).
logs:
ascii slug:127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (2) init rewrite engine with requested uri /2010/10/01/ttt/ 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (3) applying pattern '^(.*)' to uri '/2010/10/01/ttt/' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (2) rewrite '/2010/10/01/ttt/' -> '/wp-content/cache/supercache/wp.localhost//2010/10/01/ttt//index.html.gz' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (2) local path result: /wp-content/cache/supercache/wp.localhost//2010/10/01/ttt//index.html.gz 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (2) prefixed with document_root to /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2010/10/01/ttt/index.html.gz 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (1) go-ahead with /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2010/10/01/ttt/index.html.gz [OK] 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215ac538/initial] (1) [perdir /var/www/localhost/test/wpmu/wp-content/cache/] pass through /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2010/10/01/ttt/index.html.gz
(ascii slug also works.) i have seen that style are not applied, i will show style file logs later.
non-latin slug:127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (2) init rewrite engine with requested uri /2011/01/20/?/ 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (3) applying pattern '^(.*)' to uri '/2011/01/20/?/' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (2) rewrite '/2011/01/20/?/' -> '/wp-content/cache/supercache/wp.localhost//2011/01/20/%d3%a9//index.html.gz' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (2) local path result: /wp-content/cache/supercache/wp.localhost//2011/01/20/%d3%a9//index.html.gz 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (2) prefixed with document_root to /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2011/01/20/%d3%a9/index.html.gz 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (1) go-ahead with /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2011/01/20/%d3%a9/index.html.gz [OK] 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b2550/initial] (1) [perdir /var/www/localhost/test/wpmu/wp-content/cache/] pass through /var/www/localhost/test/wpmu/wp-content/cache/supercache/wp.localhost/2011/01/20/%d3%a9/index.html.gz
(works.)
what has happened to style. its behavior when it worked and rules was in directory tags: log:
127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css -> wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^(.*)' to uri 'wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css -> wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^(.*)' to uri 'wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css -> wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^index\.php$' to uri 'wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css -> wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^files/(.+)' to uri 'wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] strip per-dir prefix: /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css -> wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (3) [perdir /var/www/localhost/test/wpmu/] applying pattern '^' to uri 'wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:39:31 +0300] [wp.localhost/sid#211239c8][rid#215ec3a0/initial] (1) [perdir /var/www/localhost/test/wpmu/] pass through /var/www/localhost/test/wpmu/wp-content/themes/twentyten/style.css
its behavior when rules are not in directory tags but in virtualhost tag and style does not work:
127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (2) init rewrite engine with requested uri /wp-content/themes/twentyten/style.css 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '^(.*)' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '^(.*)' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '^index\.php$' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '^files/(.+)' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '^' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (3) applying pattern '.' to uri '/wp-content/themes/twentyten/style.css' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (2) rewrite '/wp-content/themes/twentyten/style.css' -> 'index.php' 127.0.0.1 - - [25/Jan/2011:17:33:05 +0300] [wp.localhost/sid#21115948][rid#215b0548/initial] (2) local path result: index.php
in the next post i will write about prg:customfunction (external rewriting program), if “the god” wants..
even before trying [B] and int:escape i have made prg:customfunction this time. it thought it has worked before i have started to write these posts, but now again i am trying it and i see that it does not work, but only i have successed to make it working beginning with empty apache rules.
configuration:
(but let i write configuration:)RewriteEngine On RewriteMap aylandirow2 prg:/var/www/localhost/test/localhost/aylandirow2.php RewriteRule ^/(.*)$ /var/www/localhost/test/localhost/${aylandirow2:$1} RewriteLogLevel 3 RewriteLog /var/log/apache2/rewrite.log
the aylandirow2.php’s content:
#!/usr/bin/php <?php set_time_limit(0); $fdin=fopen("php://stdin","r"); $fdout=fopen("php://stdout","w"); set_file_buffer($fdout,0); while($i=fgets($fdin)){ $i2=explode('/',rtrim($i)); $i2o=count($i2); for($j=0;$j<$i2o;$j++){ $i2[$j]=strtolower(urlencode($i2[$j])); } $o=implode('/',$i2)."\n"; fputs($fdout,$o); } ?>
i have found the way to make it in internet near 1 year ago and have not searched now again, just used code from my computer.
aylandirow2.php is runnable and it’s owner is www-data.i have just added “strtolower(” here, the big hex digits i said about probably was for this, this has generatet big hex digits without “strtolower(..)”. and btw as i remember i have seen in httpfox in firefox, that firefox randomly requests with big or small hex digits, but that is not important, anyway, rewrite rules and this function get unicode.
and i also have tried to understand [NE] flag but could not find any change of behavior by it, i think maybe there indeed is not any because my php works with fcgid.
- The topic ‘[Plugin: WP Super Cache] still not corrected… bug about unicode-range letters in permalink’ is closed to new replies.