您好,我需要为所有未找到的 url 显示 index.php 的内容,例如
http://domain.com/random must show http://domain.com/index.php content
http://domain.com/random/random.html must show http://domain.com/index.php content
http://domain.com/random/rand/random.php must show http://domain.com/index.php content
我尝试了下面的代码,但仍然没有找到错误
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([^/]+)/(.*?)/?$ /$1/index.php [L]