扁平化对 awstats 的访问的 modrewrite 规则是什么

发布于 2024-10-04 13:49:00 字数 332 浏览 0 评论 0原文

我当前访问 awstats 的 url 是

http://my.server.com/awstats/awstats.pl?config=foo

我想使用 apache 和 mod_rewrite 来

http://my.server.com/foo

我的尝试是

RewriteRule ^(.*) /awstats/awstats.pl?config=$1 [NC]

但我只是得到 404。error.log

没有给我太多帮助。

My current url to access my awstats is

http://my.server.com/awstats/awstats.pl?config=foo

I would like to use apache and mod_rewrite to

http://my.server.com/foo

My attempt is

RewriteRule ^(.*) /awstats/awstats.pl?config=$1 [NC]

but I just get a 404.

The error.log doesn't give me much help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

稚然 2024-10-11 13:49:00

尝试在后面添加 $ 以便整个字符串被正则表达式吃掉,然后使用 [L] 以便重写引擎知道停止处理并应用规则。

请记住打开重写引擎并设置重写基础。

RewriteEngine on
RewriteBase /

RewriteRule ^(.*)$ /awstats/awstats.pl?config=$1 [NC,L]

Try adding a $ after so that the entire string is eaten by the regexp, and then use [L] so the rewrite engine knows to stop processing and apply the rule.

Remember to switch on the rewrite engine and set the rewrite base.

RewriteEngine on
RewriteBase /

RewriteRule ^(.*)$ /awstats/awstats.pl?config=$1 [NC,L]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文