Apache 重写文件夹赢得';行不通

Apache 重写文件夹赢得';行不通,apache,.htaccess,mod-rewrite,rewrite,Apache,.htaccess,Mod Rewrite,Rewrite,我的服务器上有一个应用程序存储在“server_ROOT/app/1.0.1/index.php”中。通过键入“example.com/index.php”访问该应用程序,我使用重写来实现这一点 我遇到的问题是,我希望用户通过键入“example.com/image/”来访问“SERVER_ROOT/app/1.0.1/image/”,但在编辑.htaccess文件时,我的重写都无法工作 这是我的.htaccess文件: Options -MultiViews RewriteEngine on

我的服务器上有一个应用程序存储在“server_ROOT/app/1.0.1/index.php”中。通过键入“example.com/index.php”访问该应用程序,我使用重写来实现这一点

我遇到的问题是,我希望用户通过键入“example.com/image/”来访问“SERVER_ROOT/app/1.0.1/image/”,但在编辑.htaccess文件时,我的重写都无法工作

这是我的.htaccess文件:

Options -MultiViews
RewriteEngine on
RewriteBase /app/1.0.1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+) index.php/$1 [L]

RewriteRule ^image/$ app/1.0.1/image/ [NC,L]

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s ^on(s)|
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
谢谢,
Peter

由于
/image/
目录实际上并不存在,因此它将被第一条将所有内容路由到index.php的规则所束缚。假设htaccess文件位于文档根目录中,则需要在路由规则上方添加规则,并将其更改为:

RewriteRule ^image/(.*)$ image/$1 [L]
如果htaccess文件不在文档根目录中,则需要将此规则添加到文档根目录中htaccess文件的顶部:

RewriteRule ^image/(.*)$ /app/1.0.1/image/$1 [L]

如果我把它放在上面也不行。我把它放在引擎下面