Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

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

$
0
0
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;
}

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>