WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
still not corrected... bug about unicode-range letters in permalink (55 posts)

  1. qdinar
    Member
    Posted 4 years ago #

    see: http://wordpress.org/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) ) ) ) );

  2. Donncha O Caoimh
    Member
    Plugin Author

    Posted 4 years ago #

    The main reason for not fixing this is security reasons. When you urldecode $url you can create odd characters and yes, I don't know what those odd characters will do on different file systems.

    I'd love to get the opinion of a hardened security expert who knows about all this.

  3. qdinar
    Member
    Posted 4 years ago #

    ok

    i said "and it anyway do not work..." . no, it can work, depending on whether apache also will request from system files with same names, producing their names from rewrite rules.

  4. qdinar
    Member
    Posted 4 years ago #

    if use urlencoded file names... hm... urlencoded file names are used when requesting server! so they are original variant of string, not urldecoded. so why urlencoded strings do not work? because of rewrite rules may be... (i thought about this already previous time i explored this, i little remember...)
    may be it is possible to configure rewrite rules to return/output urlencoded strings? (i'll look documentation.)
    and, alternatively, i know that it is possible to make urlencoder script and use it in rewrite rules, i have made such thing. but this can be considered not fast , if script is php, but it is loaded only once, and also can be used compiled c.

  5. qdinar
    Member
    Posted 4 years ago #

    i said "urlencoded file names are used when requesting server! so they are original variant of string, not urldecoded." . it's normal. apache always do so. apache always urldecodes request and so use correct filename. it is correct.

  6. qdinar
    Member
    Posted 4 years ago #

    found:
    http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule :

    'B' (escape backreferences)
    ...
    With the B flag, it will instead map to index.php?show=/C%2b%2b

    another way, if first somehow do not work, http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewritemap :

    unescape:
    Translates hex-encodings in the key back to special characters.

    if it do not work, "External Rewriting Program", i have said about it. with this you can make it more quality (?) - escape according to system, for example, only several characters are not allowed in windows xp, like ? , " , \ . all others can be unescaped. to move from one type system to other type, can make converter of cached files or just clear cache, clear cache is more reliable, because bad characters can be even not copied correctly. and if % sign is not allowed in file names in system, this way is needed, but it, "%", had been selected as being supported by most of all or all systems and simple character, as i know.

  7. qdinar
    Member
    Posted 4 years ago #

    and there is another way to think or try out: use alias instead of rewrite! mediawiki uses this way.

  8. Donncha O Caoimh
    Member
    Plugin Author

    Posted 4 years ago #

    The escape backreference parameter looks like it might work. Can you modify your .htaccess and try it?

    It's not really possible to use aliases. You'd have to add one alias for each url on your site wouldn't you?

    The other thing the plugin could do is in the "last chance" code in wp-cache-phase1.php use the encoded url to match that on the filesystem. This code normally is the last chance to serve a supercached file to anonymous users in case the .htaccess rules are broken.

  9. qdinar
    Member
    Posted 4 years ago #

    you are sure that B does not work?
    ok, i will try.

    alias gives corresponding file that begin with string given in alias, with same ending, i think.

  10. qdinar
    Member
    Posted 4 years ago #

    i tried B also, it is needed to set to RewriteCond directive also, i think, but this directive do not allow that.

    unfortunately,

    Context: server config, virtual host

    for RewriteMap urlencode int:escape.
    i have tried to write RewriteMap urlencode int:escape in server config and ${urlencode:$1} instead of $1 in htaccess, 4 times, and i have this error:
    [Mon Jul 12 14:17:36 2010] [error] [client 127.0.0.1] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: http://wp.localhost/

    update:
    ah , it is said :

    You would then be able to use this map in a RewriteRule as follows:

    , may be i cannot use it in rewritecond? or should use other way?

  11. qdinar
    Member
    Posted 3 years ago #

    another bug after i have modified wp-cache-phase1.php : post page is not updated after comment is added. if wp-cache-phase1.php is not modified it maybe works, but do not be cached at all, i have not checked it.

    topic where i have written about i have found this bug that cache does not update and think it is related to this utf-8 permalinks : http://wordpress.org/support/topic/plugin-wp-super-cache-clear-cache-after-post-edit .

  12. qdinar
    Member
    Posted 3 years ago #

    there are many places where i think maybe adding urldecode() is needed in function wp_cache_post_change( $post_id ) { .... } in wp-cache-phase2.php.

  13. qdinar
    Member
    Posted 3 years ago #

    i have remembered/understood while reading mod rewrite docs how to make redirect with urlencode with rewritecond, i will try it tomorrow, if the god wants. ... no, i think maybe i have been mistaken/confused...

  14. qdinar
    Member
    Posted 3 years ago #

    i have said:

    alias gives corresponding file that begin with string given in alias, with same ending, i think.

    as i have seen one day, it is so only if location is alias of directory or php file (or other such script), in case of php file location can be gotten with $_SERVER's varaibles, in case of directory, sublocations become alias for corresponding subdirectories and files in them.

  15. qdinar
    Member
    Posted 3 years ago #

    i said:

    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) ) ) ) );

    this fix is not good, incorrect, incomplete, it breaks blog: if comment is added to post with non-latin slug, the post's cache is not updated, new comment do not show up. So for now do not use this fix, leave the plugin as it was. It works, even it serves from super-cache file. Disadvantages are : 1. its speed is only very little slower than if it is served with "half on" mode. 2. It does not reply with 304 status if the cache is not modified. 3. It does not serve gzipped file.
    So suggestion appear in mind: please make this mode so that it can respond with 304 status and can serve gzipped file, i think it is possible. Even it seems easy, maybe i will try to make it... But ... Seems Donncha now makes this mode, of serving supercached file with php, more advanced, may be he is already going to do/make these. Approvement: http://ocaoimh.ie/easy-setup-wp-super-cache/ :

    This version also adds a new method of serving cache files. It uses PHP, but serves supercache files. So, it’s a halfway house between using mod_rewrite (difficult to install for some users), and the legacy caching of WP Cache. That caching will be what is activated for users who use the simplified settings page.

    There is also link to download development version, i will now look at it.

  16. qdinar
    Member
    Posted 3 years ago #

    i have looked it, "// last chance, check if a supercache file exists. Just in case .htaccess rules don't work on this host" section in wp-cache-phase1.php is not yet modified... this code runs in case of non-latin slugs in super-cache mode.

  17. qdinar
    Member
    Posted 3 years ago #

    what i have said in the previous post here is wrong, it is modified, gzipped file serving is added.

  18. qdinar
    Member
    Posted 3 years ago #

    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 );
  19. qdinar
    Member
    Posted 3 years ago #

    i have moved this post to previous post.
    moderators, please delete, if you see.

  20. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  21. qdinar
    Member
    Posted 3 years ago #

    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.

  22. qdinar
    Member
    Posted 3 years ago #

    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?)

  23. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    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 :(

  24. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  25. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  26. qdinar
    Member
    Posted 3 years ago #

    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 );
  27. Donncha O Caoimh
    Member
    Plugin Author

    Posted 3 years ago #

    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.

  28. qdinar
    Member
    Posted 3 years ago #

    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: http://msdn.microsoft.com/en-us/library/aa365247%28v=vs.85%29.aspx#naming_conventions . info about FAT and mac os: http://support.grouplogic.com/?p=1607 . wikipedia: http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words .

  29. qdinar
    Member
    Posted 3 years ago #

    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.

  30. qdinar
    Member
    Posted 3 years ago #

    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..

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic