# Rewriteing awstats to base path

**URL:** <https://www.ruby-forum.com/t/rewriteing-awstats-to-base-path/238291>\
**Category:** NGINX\
**Created:** [January 1, 2014, 5:44pm UTC](https://www.ruby-forum.com/t/rewriteing-awstats-to-base-path/238291 "2014-01-01T17:44:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 1, 2014, 5:44pm UTC](https://www.ruby-forum.com/t/rewriteing-awstats-to-base-path/238291/1 "2014-01-01T17:44:18Z")

</div>

Hi,

I like to beautify my urls used for awstats.

Currently I have to use the following path for awstats

> /cgi-bin/awstats.pl?[config=www.example.com](http://config=www.example.com)  
> that works as expected.

For easier handling for our users I like to shorten the url to  
/www.example.com  
I tried a simple rewrite like

> rewrite ^/www.example.com$ /cgi-bin/awstats.pl?[config=www.example.com](http://config=www.example.com);

but I’ll get the following error

> 2013/12/31 23:43:20 [error] 23736#0: \*1 open()  
> “/srv/awstats/dist/wwwroot/awstats.pl” failed (2: No such file or directory),  
> client: ::ff:123.123.123.123, server: [awstats.example.com](http://awstats.example.com), request: “GET  
> /awstats.pl?[config=www.example.com](http://config=www.example.com)&framename=mainleft HTTP/1.1”, host:  
> “[awstats.example.com](http://awstats.example.com)”, referrer: “[http://awstats.example.com/www.example.com](http://awstats.example.com/www.example.com)”

here is the full server block

> ```
> include fastcgi_params;
> 
> ```
> 
> }  
> Desired url [http://awstats.example.com/www.example.com](http://awstats.example.com/www.example.com)

Probably I didn’t fully understand the rewrite rules.

Hopefully you can help!

Best regards  
moe
