在PHP和html中重写/掩码url地址


rewrite/mask url address in php and html

我读了很多关于如何重写url的帖子,但我仍然找不到重写以下内容的方法:

www.mysite.com/index.php
www.mysite.com/login.html

只显示为:

www.mysite.com

任何想法?

一般应该是这样的:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?$1 [L,QSA]
</IfModule>

我建议你看这里删除'index.php'从URL with .htaccess中获得更具体的答案,在这里获得教程