我有這樣的設置http://www.example.com/reroute/index.php。 我想發送所有請求不要index.php到index.php。因此,任何到/reroute /產品將去/reroute/index.php和將顯示http://www.example.com/reroute到瀏覽器。它似乎很簡單,但我試過的每件事都告訴我文件不存在或發送給我一個循環。.htaccess重定向請求不index.php
另外,是否可以在我重新路由之前設置自定義標題?
Options +FollowSymLinks
IndexIgnore */*
# Turn on the RewriteEngine
RewriteEngine On
RewriteCond %{IS_SUBREQ} false
RewriteRule ^/index\.php$ http://www.example.com/reroute [R=301,L]