.htaccess 无法使mod_重写正常工作

.htaccess 无法使mod_重写正常工作,.htaccess,mod-rewrite,mamp,.htaccess,Mod Rewrite,Mamp,我已经找了几个小时试图找到一个解决办法。我一定错过了什么。我正在尝试清理我的URL 我让我的索引页根据一个动作生成页面。基本上: <?php include("header.htm"); $action = $_GET['action']; $action = basename($action); if (!empty($_GET['action'])) { if (file_exists("$action.htm") } else { include("inde

我已经找了几个小时试图找到一个解决办法。我一定错过了什么。我正在尝试清理我的URL

我让我的索引页根据一个动作生成页面。基本上:

    <?php
include("header.htm");
$action = $_GET['action'];
$action = basename($action);

if (!empty($_GET['action'])) {
    if (file_exists("$action.htm")
} else {
    include("index.htm");
}
include("footer.htm");
?>

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/galleries$ /?action=galleries
</IfModule>