.htaccess根本不工作

时间:2010-04-30 08:38:47

标签: apache mod-rewrite

我想更改此网址

localhost/classAds/classInc/home.php

localhost/classAds/classInc/home/

为此我创建.htacess文件如下,

RewriteEngine On                #Turn on the rewriting engine
RewriteRule     ^home/?$    home.php    [NC,L]   #Handle requests for "home"

并将此文件放入

C:\ wamp \ www \ classAds,然后是C:\ wamp \ www \ classAds \ classInc

但是在两个地方它都没有用,我检查了Apache错误日志,但没有。 实际上我是这个东西的新手.. 有什么想法吗?

1 个答案:

答案 0 :(得分:0)

您需要将文件命名为.htaccess(两个c),并将其放在网站的根文件夹中,以执行您需要的重写。

RewriteEngine on
RewriteRule ^Home/ home.php [L,NC,QSA]
RewriteRule ^Home home.php [L,NC,QSA]