Plugin Directory

Changeset 1842014


Ignore:
Timestamp:
03/17/2018 08:01:40 PM (8 years ago)
Author:
3UU
Message:

optimize RewriteRules

Location:
flexistatic/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • flexistatic/trunk/flexistatic.php

    r1561220 r1842014  
    122122      // if index.html get preference. E.g. the very usefull "Simple Custom CSS".
    123123      echo "<p>".__('Attention: Some more ore less usefull plugins do need direct requests to the <code>index.php</code> in the blog root folder. Therefor you should add','flexistatic')," ";
     124$SUBDIR="FR/"; // rtzrtz: must end with an "/"
    124125      echo "<pre>            # FlexiStatic
     126            # first make shure that we do not match
     127            # requests with dynamic parameters. Also
     128            # make sure that the webserver prefers
     129            # 'index.html' over directory listing
    125130            RewriteEngine On
    126             RewriteCond %{REQUEST_URI} ^/(index|%{HTTP_HOST})\.html
     131
     132            RewriteBase /".$SUBDIR."
     133            RewriteCond %{REQUEST_URI} (index|%{HTTP_HOST})\.html$
    127134            RewriteCond %{QUERY_STRING} !^$
    128135            RewriteRule . /index.php [L]</pre>";
    129136      echo "<pre>            ### only needed for WPMU ###
    130             RewriteCond %{REQUEST_FILENAME} /$
    131             RewriteCond %{DOCUMENT_ROOT}/%{HTTP_HOST}.html -f
     137            RewriteCond %{REQUEST_URI} ^/".$SUBDIR."$
     138            RewriteCond %{QUERY_STRING} ^$
     139            RewriteCond %{DOCUMENT_ROOT}/".$SUBDIR."%{HTTP_HOST}.html -f
    132140            RewriteRule .* %{HTTP_HOST}.html [L]
    133141            # END FlexiStatic
    134142      </pre>";
     143     
    135144      printf ( __("to your <code>%s/.htaccess</code> file.",'flexistatic'), $_SERVER['DOCUMENT_ROOT'].wp_make_link_relative(get_site_url()) );
    136145      echo "</p>";
     
    253262         rename($path,$path.'static3UU');
    254263         // request the dynamit content from WP
    255          $content2=file_get_contents(get_site_url().$wsfile)."<!-- static3UU|autocreate -->";
     264         $content2=file_get_contents(get_site_url().$wsfile)."<!-- static3UU|autocreate|$wsfile -->";
    256265         // if we had have an old static dir, we move it back
    257266         if(is_dir($path.'static3UU'))   rename($path.'static3UU',$path);
  • flexistatic/trunk/readme.txt

    r1561220 r1842014  
    33Tags: static page, performance
    44Requires at least: 4.4
    5 Tested up to: 4.7
    6 Stable tag: 2.0.1
     5Tested up to: 4.9.4
     6Stable tag: 2.0.2
    77License: MIT
    88License URI: http://opensource.org/licenses/mit
     
    5858time.
    5959
    60 = Q: My browser start a "download" if request a static file =
    61 A: If your permalinks are defined as directories, the webserver can not
    62 know the MIME type of the static file. It is up to you that your
    63 webserver will send the correct headers.
    64 
    6560= Q: I get security warnings of the browser if I request a static file =
    6661A: If your server support http and https please make sure to create the
     
    9994
    10095== Changelog ==
     96
     97= 2.0.2 =
     98- optimize RewriteRules to work with installations in subdirs
    10199
    102100= 2.0.1 =
Note: See TracChangeset for help on using the changeset viewer.