Adaptive images CakePHP htaccess

前端 未结 1 1263
天涯浪人
天涯浪人 2021-01-01 06:32

I\'m trying to get Matt Wilcox adaptive images to work with CakePHP without success. http://adaptive-images.com/

CakePHP comes with three .htaccess files of it\'s ow

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-01 07:15

    Alright I got it working even if it's perhaps not the most optimal solution there is.

    I only changed the htaccess in the /app/webroot-folder like below

    
        Options +FollowSymlinks
        RewriteEngine On
    
        RewriteCond %{REQUEST_URI} !debug_kit
        RewriteRule \.(?:jpe?g|gif|png)$ adaptive-images.php [L]
    
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^(.*)$ index.php [QSA,L]
    
    

    and added the adaptive-images.php file to app/webroot It would perhaps be nicer to have the adaptive-images.php file in the Vendor directory but at least it works.

    I made two changes in adaptive-images.php

    $cache_path    = "app/tmp/cache/ai-cache";
    $source_file    = $document_root.'/app/webroot'.$requested_uri;
    

    0 讨论(0)
提交回复
热议问题