2010-04-30 42 views
0

工作,我想这个网址的.htaccess完全不

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错误日志但没有任何东西。 其实我是一个新的东西.. 任何想法,请??

+2

经常因为你拼写错误“的.htaccess”的文件被称为“的.htaccess” http://httpd.apache.org/docs/2.1/howto/htaccess.html – mattanja 2010-04-30 08:42:47

+0

也许它无法正常工作。 – 2010-04-30 08:43:21

+0

一些提示: 1.确保您的主机或虚拟主机的AllowOverride指令为ON 2.确保已安装apache重写模块,并且可以正确加载 – Andreas 2010-04-30 09:12:16

回答

0

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

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

我只是检查我的apache_error.log,发现类似那样的错误 [错误] [客户端127.0.0.1]客户端被服务器配置拒绝:C:/ Program Files/Apache Software Foundation,referer:http:// localhost/classAds/classInc/ 有什么想法吗? – shuja 2010-05-03 06:17:34

+0

你需要检查你的根配置 - 看看这个解释:http://www.raditha.com/blog/archives/896.html – Fenton 2010-05-04 06:37:07