Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用htaccess将URL从index.php重写为index.html_Php_Mod Rewrite - Fatal编程技术网

使用htaccess将URL从index.php重写为index.html

使用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

我想重写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
 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()检查是否启用了它?