Apache,mod_rewrite。简单且经过验证的RewriteRule不起作用

时间:2014-04-11 01:23:38

标签: apache mod-rewrite localhost

动态网址: http://localhost/?langName=spa

重写的网址: http://localhost/spa

以下是 .htaccess 完整内容

DirectoryIndex ed.php
<IfModule mod_rewrite.c>
  RewriteEngine On
  Options +FollowSymlinks
  RewriteBase /
  RewriteRule //(.*)/(.*)/$ /?$1=$2
</IfModule>

结果:

The requested URL /spa was not found on this server.

Apache/2.0.59 (Win32) PHP/5.2.3 Server at localhost Port 80

拜托,错误在哪里? 谢谢!

1 个答案:

答案 0 :(得分:0)

这应该做的工作:

RewriteBase /

RewriteCond %{QUERY_STRING} langName=([a-z]+)
RewriteRule ^$ %1