Rewrite all files from newfolder to index.html
问题 I have this code: RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} (mozilla|navigator|chrome) [NC] RewriteRule ^/newfolder/(.+) /index.html/$1 [L,NC] I want all files from newfolder (located in public_html) to be rewrite to index.html which is in public_html, ofcourse. Any help please... 回答1: Remove leading slash from your regex to match URI: RewriteEngine On RewriteBase / RewriteCond %{HTTP_USER_AGENT} (mozilla|navigator|chrome) [NC] RewriteRule ^newfolder(/|$) /index.html [L,NC