重定向不存在的文件夹mod_rewrite

时间:2012-09-28 08:19:01

标签: .htaccess mod-rewrite

如何重定向某个网址请求,例如:

http://sample.org/www/images/animal.png

文件结构:

ROOTPATH /图像/ animal.png

ROOTPATH /网络/

1 个答案:

答案 0 :(得分:0)

尝试将其放入文档根目录中的htaccess文件中:

RewriteEngine On
RewriteCond %{REQUEST_URI} ^/www/(.*)$
RewriteCond %{DOCUMENT_ROOT}/%1 -f
RewriteRule ^/?www/(.*)$ /$1 [L]
相关问题