开发者

What is the modrewrite rule to flatten access to awstats

开发者 https://www.devze.com 2023-01-26 16:19 出处:网络
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

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 开发者_JS百科[NC]

but I just get a 404.

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


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]
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号