ash*_*eta 3 apache url-rewriting
我想重定向" http://localhost/b.html " - >" http://localhost/a.html "我为此尝试了RewriteRule.但不知何故,它对我不起作用.
我正在使用apache2,我的httpd.conf包含:
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule rewrite_module modules/mod_rewrite.so
RewriteEngine On
RewriteRule ^/b.html$ http://localhost/a.html
Run Code Online (Sandbox Code Playgroud)
当我三" http://localhost/a.html "它显示我的网页.但当我triend" http://localhost/b.html "apache2/error_log说"文件不存在:b.html"是否缺少任何设置以启用rewrite_module?
问题在于你的RewriteRule.这应该工作:
RewriteEngine On
RewriteRule ^/b.html$ /a.html [L]
Run Code Online (Sandbox Code Playgroud)
^b.html$)不得包含起始斜杠.[L]eave处理(不再处理规则)