【发布时间】:2015-09-01 08:11:24
【问题描述】:
我有很多文件,包括图像、php&js 脚本和子文件夹。
我需要使用 .htaccess 将任何 uri 重定向到 index.php。
例如:
www.example.com/test should be redirect to index.php
但不应将图像重定向到 index.php。相反,它应该直接在浏览器中打印。
例如:
www.example.com/sample.jpg should display sample.jpg.
我在 .htaccess 代码中使用以下代码:
RewriteEngine On
RewriteRule ^(.*)$ index.php
谁能解释一下如何让图片显示?
【问题讨论】:
标签: php regex apache .htaccess redirect