# Apache rewriting rule to access non-rails static page

**URL:** <https://www.ruby-forum.com/t/apache-rewriting-rule-to-access-non-rails-static-page/125177>\
**Category:** Rails\
**Created:** [January 6, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/apache-rewriting-rule-to-access-non-rails-static-page/125177 "2008-01-06T18:31:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [January 6, 2008, 6:31pm UTC](https://www.ruby-forum.com/t/apache-rewriting-rule-to-access-non-rails-static-page/125177/1 "2008-01-06T18:31:16Z")

</div>

I am running my rails app at :

[http://www.mydomain.tld](http://www.mydomain.tld)  
which is used for all my  
[http://www.mydomain.tld/](http://www.mydomain.tld/)//…

I have the following rewriting rules for Apache2 :

DocumentRoot /var/rails/mydomain/current/public  
RewriteEngine On

# Rewrite index to check for static

RewriteRule ^/$ /index.html [QSA]

# Rewrite to check for Rails cached page

RewriteRule ^([^.]+)$ $1.html [QSA]

# Redirect all non-static requests to cluster

RewriteCond %{DOCUMENT\_ROOT}/%{REQUEST\_FILENAME} !-f  
RewriteRule ^/(.\*)$ balancer://mydomain\_cluster%{REQUEST\_URI} [P,QS$

but I need to access my web statistics(written by a cron job with  
awstats) from a static page  
which is located at : /var/www/vhosts/mydomain/statistics/webstat

I don’t pick up yet what I should modify Apache2 config OR my rails  
app routes .

thanks for your help & happy new year

kad

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [January 6, 2008, 9:48pm UTC](https://www.ruby-forum.com/t/apache-rewriting-rule-to-access-non-rails-static-page/125177/2 "2008-01-06T21:48:57Z")

</div>

You could use the alias module for this purpose.  
Have a look at the Apache documentation:  
[http://httpd.apache.org/docs/2.0/mod/mod\_alias.html](http://httpd.apache.org/docs/2.0/mod/mod_alias.html)  
(or if you are using Apache 1.3  
[http://httpd.apache.org/docs/1.3/mod/mod\_alias.html](http://httpd.apache.org/docs/1.3/mod/mod_alias.html))

On Jan 6, 6:31 pm, Kad K. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
