Note that there are some explanatory texts on larger screens.

plurals
  1. PO.htaccess and mod_rewrite conditions
    primarykey
    data
    text
    <p>I'm using a cache busting engine for my CSS and JS scripts based on PHP and .htaccess. So in PHP i built the following function:</p> <pre><code>function CreateFileFingerprint($RelativePath) { $PathInfo = pathinfo($RelativePath); return $PathInfo['dirname'].'/'.$PathInfo['filename'].'.'.filemtime(DATA_BASEPATH.$RelativePath).'.'.$PathInfo['extension']; } </code></pre> <p>While in my .htaccess I use expiration headers:</p> <pre><code>FileETag None Header Unset ETag ExpiresActive On ExpiresDefault A2592000 ExpiresByType application/javascript A31536000 ExpiresByType text/css A31536000 ExpiresByType text/javascript A31536000 &lt;FilesMatch "[^\.php]$"&gt; Header Append Cache-Control "public" &lt;/FilesMatch&gt; </code></pre> <p>And a little mod_rewrite rule:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)\.(\d+)\.(css|js)$ $1.$3 [L] </code></pre> <p>Then in my PHP page I use the following code:</p> <pre><code>echo '&lt;link rel="stylesheet" href="'.self::CreateFileFingerprint('/styles/style-base.css').'" media="all"/&gt;'; </code></pre> <p>Everything works fine, but now I would like to implement an universal PHP ErrorDocument for my site like explained <a href="http://kb.siteground.com/article/How_to_create_a_universal_error_page_for_Joomla.html" rel="nofollow">here</a>. The problem is that I need to merge my previous mod_rewrite rule with the one suggested in the link:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^.*$ /errors/error.php [L] </code></pre> <p>Can someone help me please? Many thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload