DooPHP - fastest MVC based PHP framework

Learn More

The Official Blog of DooPHP

News, Updates, Tips & Tricks for DooPHP

Subscribe to Blog

Subscribe to the official blog of DooPHP framework.

Using DooPHP on Nginx Rewrite Rule2009-08-12 03:10:36

Using DooPHP on Nginx Rewrite Rule

For those who are using DooPHP with Nginx and wanted to have clean URLs without the index.php, here's my settings for the rewrite rules. I hope it works for you.

      location ~ \.php {     
         fastcgi_pass  127.0.0.1:9000;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;
         fastcgi_param PATH_INFO $fastcgi_script_name;
         access_log off;
      }
      
      location /doophp_svn/app/ {
         index  index.php;
         if (!-e $request_filename){
            rewrite (.*) /doophp_svn/app/index.php/$1;
         }
      }

It can be access via:

http://localhost/doophp_svn/app/
http://localhost/doophp_svn/app/index.php
http://localhost/doophp_svn/app/allurl
http://localhost/doophp_svn/app/index.php/allurl

Also, remember to change the configs in the demos for them to work properly. Do change the SITE_PATH, BASE_PATH, SUBFOLDER and APP_URL.

If you have a better solution, do post it in the Tips & Tricks forum


Published under: Tips & Tricks Share/Save/Bookmark

0 Comments:

Be the first to comment. :)

Leave a Reply

About

Categories

Archives


Syndication