# Very Simple htaccess rule

**URL:** <https://www.ruby-forum.com/t/very-simple-htaccess-rule/204632>\
**Category:** NGINX\
**Created:** [March 17, 2011, 11:04am UTC](https://www.ruby-forum.com/t/very-simple-htaccess-rule/204632 "2011-03-17T11:04:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [March 17, 2011, 11:04am UTC](https://www.ruby-forum.com/t/very-simple-htaccess-rule/204632/1 "2011-03-17T11:04:45Z")

</div>

Hi Nginx.

Properly so simple you may laugh , but this world save my day 🙂

RewriteEngine On

RewriteBase /

RewriteCond %{SCRIPT\_FILENAME} !-f  
RewriteCond %{SCRIPT\_FILENAME} !-d  
RewriteRule ^(.\*)$ site/$1 [NC,L,QSA]  
RewriteRule ^$ site/index.php [NC,L,QSA]

When you hit the [domain.com](http://domain.com) i simple need to access  
[domain.com/site/index.php](http://domain.com/site/index.php).

After this info , i would like to study the rules more intense.  
But i’m in a shortage of time right now.

Thanks In advance…

/Michael

Posted at Nginx Forum:

> **[Very Simple htaccess rule](https://forum.nginx.org/read.php?2,183435,183435#msg-183435)**
>
> Hi Nginx. Properly so simple you may laugh , but this world save my day :-) RewriteEngine On RewriteBase / RewriteCond %{SCRIPT\_FILENAME} !-f RewriteCond %{SCRIPT\_FILENAME} !-d RewriteRule ^(.\*)$ site/$1 \[NC,L,QSA\] Rewr

---

<div class="post-metadata">

**Author:** ![michaelvv](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/439d5e/32.png) [@michaelvv](https://www.ruby-forum.com/u/michaelvv)\
**Post date:** [March 17, 2011, 10:05pm UTC](https://www.ruby-forum.com/t/very-simple-htaccess-rule/204632/2 "2011-03-17T22:05:43Z")

</div>

try this:

location / {  
try\_files $request\_uri $request\_uri/ site$request\_uri site/index.php;  
}

Note: You shold define the php location in order to serve php page.

Il 17/03/2011 11:03, michaelvv ha scritto:
