Htaccess将所有.html页面重定向到php-get变量


Htaccess redirect all .html pages to php get variables

我的URL当前如下:

/events.html/contact.html

我想做的是,将它们重定向到php-get变量。

E.g events.html=index.php?page=事件

关于如何做到这一点,有什么想法吗?

非常感谢。

您正在此处查找mod_rewrite

根据该规则,(假设mod_rewrite已安装并启用,并且您将其放在.htaccess文件中)

RewriteEngine on
RewriteRule ^/(.*).html /index.php?page=$1