我的htaccess文件有问题 这是我的文件夹结构:
- /scripts/ - common php scripts
- /static/ - static file - mainly photos
/photos/ - image files
/.htaccess - *static htaccess* if there is no photos's dimentions - create one
- /photos/ - photos subdomain
/.htaccess - *photos htaccess* handling slim for that subdomain
- /www/ - www subdomain
- /.htaccess - *main htaccess* separation of subdomains
我的问题是,当我致电http://static.domain.local/photos/my-photo.jpg
时,请求首先转到照片htaccess ,然后转到照片htaccess ,更改路径,因为已请求404错误文件不在/photos/
文件夹中。它应该转到/static/photos/
并找到(或不找到)此文件。
我总是得到错误的脚本执行。
以下是我的htacces文件:
主要htaccess
Options FollowSymLinks
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.(local|pl)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ www/public%{REQUEST_URI} [QSA,L]
RewriteCond %{HTTP_HOST} ^photos.domain.(local|pl)$
RewriteRule ^ photos%{REQUEST_URI} [QSA,L]
RewriteCond %{HTTP_HOST} ^static.domain.(local|pl)$
RewriteRule ^ static%{REQUEST_URI} [QSA,L]
静态htaccess
Options FollowSymLinks
RewriteEngine On
ErrorDocument 404 /generate.php
照片htaccess
Options FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]