.htaccess从每个索引重定向.html在任何地方到www/index.php



我有一个网站是这样说的:

images / index.html  
images/nav / index.html  
styles/ index.html  
styles/images/ index.html  
js/ index.html 
index.php  

我想使用 .htaccess 重写模块从每个索引重定向.html站点中的任何位置到索引.php

这是我测试的内容,但没有让我达到预期的结果:

RewriteRule ^index.htm$ index.php [NC,R]

任何肝素将不胜感激

通过httpd.conf启用mod_rewrite和 .htaccess,然后将此代码放在.htaccess DOCUMENT_ROOT目录下:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^(.*?)index.html?$ %1/index.php [L,R,NC]

相关内容

最新更新