Htaccess redirect all .html pages to php get variables
问题 My urls are currently like: /events.html /contact.html What I want to do is, redirect them to a php get variable. E.g events.html = index.php?page=events Any ideas on how this could be accomplished? Thanks A lot. 回答1: You are looking for mod_rewrite here. With the rule something along the lines of (assuming mod_rewrite is installed and enabled and you're putting it in a .htaccess file) RewriteEngine on RewriteRule ^/(.*).html /index.php?page=$1 来源: https://stackoverflow.com/questions/11670997