【发布时间】:2014-01-21 21:05:04
【问题描述】:
我需要为单个站点设置密码保护。这是一个 seo 友好的网址: 默认路径为:
http://www.website-url.com/index.php?id_cms=xx&controller=cms
这里是 seo 网址:
http://www.website-url.com/content/xx-login
我已经有了 .htaccess 和 .htpasswd,但是如何指定仅在 .htaccess 中重写这个 url?我试过这个:
<filesMatch "http://www.website-url.com/content/xx-login">
IndexIgnore .htaccess .htpasswd
AuthUserFile /absolut_path/.htpasswd
AuthName "Login"
AuthType Basic
require valid-user
</filesMatch>
我正在使用 Prestashop。
【问题讨论】:
-
如果你想重写 URL,你需要查看 mod_rewrite
标签: .htaccess url rewrite prestashop .htpasswd