重写查询字符串

时间:2011-06-06 02:08:09

标签: apache rewrite

我有一个网址"www.abc.com/index.php?page/Secure"

我想用"www.abc.com/secure"

访问它

我试图为"index.php?page/Secure"添加.htaccess登录 但我被告知我需要使用LocationMatch而这样做我需要重写网址。

@mike,谢谢你的解决方案工作

但是当我尝试使用htaccess保护位置时,我现在得到500错误

<Location /secure>
     AuthType Basic
     AuthName "Secure Area"
     AuthUserFile .htpasswd
     Require valid-user
</Location>

` 我的.htaccess和.htpasswd在同一个目录上,这是公共的/ w

1 个答案:

答案 0 :(得分:0)

针对该特定页面:

# Enable Rewrite Engine
RewriteEngine on

#Create friendly URL
RewriteRule ^secure$ index.php?page/secure [L]

尝试使用:http://turnkey-buddy.com/mod_rewrite_tool/

这是一个免费的重写生成器。像魅力一样。

相关问题