2011-06-06 146 views
0

我有一个网址"www.abc.com/index.php?page/Secure"重写查询字符串

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

我尝试添加的.htaccess登录电子为"index.php?page/Secure" 访问它,但是有人告诉我,我需要使用LocationMatch要做到这一点我需要重写网址。

@mike,感谢您的解决方案工作

但我现在得到一个500错误,当我尝试与htaccess的

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

` 我的.htaccess固定位置和htpasswd的在同一目录,这是大众/ W

回答

0

对于特定页面:

# Enable Rewrite Engine 
RewriteEngine on 

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

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

这是一个免费的重写生成器。奇迹般有效。

+0

http://www.fantomaster.com/faarticles/rewritingurls.txt对此很有帮助 – Swift 2011-06-06 02:20:58

+0

我只希望特定的网址被重写 – heshanh 2011-06-06 02:22:20

+0

更新了它。这应该做的窍门 – Swift 2011-06-06 02:35:24