url rewriting on localhost

2019-09-20 04:17发布

问题:

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

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.

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.

Thanks

This is resolved.

回答1:

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.