Welcome! Log In Create A New Profile

Advanced

rewrite / to index.php and /admin to admin.php

Posted by patrickk 
rewrite / to index.php and /admin to admin.php
April 11, 2013 07:40AM
Hello there,

i have a problem. i have 2 php files index.php & admin.php. I want to request the two files as follows:

index.php:
/index.php/welcome/index/...
/welcome/index/...

admin.php
/admin.php/welcome/index/...
/admin/welcome/index/...

My config:
root /usr/share/nginx/www/foobar/;
index index.php index.html index.htm;

location / {
try_files $uri $uri/ /index.php;
}

location ~ .php/ {
rewrite ^(.*.php)/ $1;
}

if (!-d $request_filename) {
rewrite ^/(.+)/$ /$1 permanent;
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/www/foobar;
}

location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}

location ~ /\.ht {
deny all;
}
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 266
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready