# Example.com/foo redirect to example.com/foo/index.php

**URL:** <https://www.ruby-forum.com/t/example-com-foo-redirect-to-example-com-foo-index-php/224279>\
**Category:** NGINX\
**Created:** [November 6, 2012, 2:38pm UTC](https://www.ruby-forum.com/t/example-com-foo-redirect-to-example-com-foo-index-php/224279 "2012-11-06T14:38:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![aris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/258eb7/32.png) [@aris](https://www.ruby-forum.com/u/aris)\
**Post date:** [November 6, 2012, 2:38pm UTC](https://www.ruby-forum.com/t/example-com-foo-redirect-to-example-com-foo-index-php/224279/1 "2012-11-06T14:38:21Z")

</div>

hello,  
my config looks like:

server {  
listen 443;  
server\_name foobar;

```
      access_log /var/log/nginx/https.access_log;
      error_log /var/log/nginx/https.error_log debug;

      index index.php index.html index.htm;
      fastcgi_index index.php;
      root /home/www/ssl/foobar;

      ssl on;
      ssl_certificate /etc/nginx/ssl/server.crt;
      ssl_certificate_key /etc/nginx/ssl/server.key;

      location ~ ^/mailadmin/(.*\.php)$ {
          root/home/www/ssl/foobar/mailadmin/bin/$1;
          fastcgi_pass 127.0.0.1:9000;
          fastcgi_index index.php;
          include /etc/nginx/fastcgi_params;
          fastcgi_param SCRIPT_FILENAME $request_filename;
      }

```

}

a request tohttps://foobar/mailadmin/index.php is done very well and  
the index.php is shown  
a request tohttps://foobar/mailadmin/ is shown Error 403 Forbidden

How can i solve that a request tohttps://foobar/mailadmin/ is also  
shown the index.php ?
