0
我是新的htaccess。所以我需要在URL中将.php重写为.html。位于子文件夹的htaccess
http://www.domain.us/sub1/sub2/sub2/index.php
我需要重写
我的文件作为 http://www.domain.us/sub1/sub2/sub2/index.html.
我试过的东西
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} site
RewriteRule ^(.*)\.php$ http://www.domain.us/sub1/sub2/sub3/$1.html [R,L]
,但它显示404 error
。
谢谢。
它重写URL,但www.domain.us/index.html。我需要在同一个文件夹中重写。这是http://www.domain.us/sub1/sub2/sub2/index.html。 –
根据你的问题你想把'/ sub1/sub2/sub2/foo.php'写到'/ sub1/sub2/sub2/foo.html'?这是不对的? – anubhava