URL重写在localhost [英] url rewriting on localhost
问题描述
我有我的本地机器上安装WAMP。我已经配置了rewrite_mod的Apache模块,并试图一个非常简单的例子来重定向
I have WAMP installed on my local machine. I have configured the apache module for rewrite_mod and trying a very basic example to redirect
RewriteEngine on
RewriteRule ^alice.html$ bob.html
根据此规则时,我打我alice.html应查看bob.html内容。但是,我认为URL重写不是有效的。
As per this rule when I hit alice.html I should be viewing bob.html content. But, I think the url rewriting is not effective.
我在www和alice.html放在/ test文件夹和bob.html都是在测试文件夹内的地方。
I have /test folder placed under www and alice.html and bob.html both are place inside the test folder.
任何意见,以解决这个问题。
Any advice to resolve this.
感谢
这是解决的。
推荐答案
您是否启用Apache的mod_rewrite的模块?您需要启用这个模块使用重写指令。不要忘记启用模块后重新启动Apache。
Did you enable the mod_rewrite module for Apache ? You need to enable this module for using rewrite directives. Don't forget to restart Apache after enabling the module.
这篇关于URL重写在localhost的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!