使用htaccess将URL从index.php重写为index.html
我想重写url 我使用.htaccess代码作为使用htaccess将URL从index.php重写为index.html,php,mod-rewrite,Php,Mod Rewrite,我想重写url 我使用.htaccess代码作为 RewriteEngine on RewriteRule ^index.html$ index.php [L] URL是 我想把url index.php重写为index.html 有人能告诉我重写的想法吗试试这个 RewriteEngine on RewriteRule ^(.*)\.html$ $1.php [nc] 取决于你的.htaccess文件在哪里。如果它是在你的根folder比你将有 RewriteEngine on Rew
RewriteEngine on
RewriteRule ^index.html$ index.php [L]
URL是
我想把url index.php重写为index.html
有人能告诉我重写的想法吗试试这个
RewriteEngine on
RewriteRule ^(.*)\.html$ $1.php [nc]
取决于你的.htaccess文件在哪里。如果它是在你的根folder比你将有
RewriteEngine on
RewriteRule ^dashboard/index.html$ /dashboard/index.php [L]
你可以用
以下代码
RewriteEngine On
RewriteRule ^(.*)\.html$ $1.php [L]
如果您希望将其作为重定向而不是重写来完成,请将[L]修改为[L,R]不起作用。我在ubuntu服务器上工作。我启用了mod_重写。mod_rewrite Enable是否存在任何问题如果未启用,则无法工作。首先使用php_info()检查是否启用了它?