Jump to content

Friendly URLs Work for Everything Except Home


Recommended Posts

Hello Everyone,

 

I've been working with PrestaShop for the last few weeks, and I've been very happy with it.  I am attempting to implement friendly URLs on my site, and all of my categories, products, and static pages display correctly, except for the home page.  All I get is a 403 forbidden.  

 

I'm running Nginx on Ubuntu 12.04

 

My vhost file:

server {
    listen   80;
    server_name www.domain.com;
        
    root   /usr/share/nginx/www;

    location /blog/ {
        index index.php;
        if (!-e $request_filename) {
           rewrite ^/blog/(.+)$ /blog/index.php?q=$1 last;
        }
    }

    location /shop/ {
    
        rewrite ^/shop/api/?(.*)$ /shop/webservice/dispatcher.php?url=$1 last;
        rewrite ^/shop/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$1$2$3.jpg last;
        rewrite ^/shop/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$1$2$3$4.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
        rewrite ^/shop/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /shop/img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
        rewrite ^/shop/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /shop/img/c/$1$2$3.jpg last;
        rewrite ^/shop/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /shop/img/c/$1$2.jpg last;
        rewrite ^/shop/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /shop/js/jquery/plugins/fancybox/images/$1.$2 last;
        rewrite ^/shop/order$ /shop/index.php?controller=order last;
        if (!-e $request_filename) {
                rewrite ^/shop/.*$ /shop/index.php last;
        }
    }

    location / {
        index index.html index.php; 
        try_files $uri $uri/ /index.php?q=$uri&$args;
        expires max; ## Enable max file cache
        }
       location ~ \.php$ {
                try_files $uri =404;
                include /etc/nginx/fastcgi_params;
                fastcgi_pass 127.0.0.1:9000;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                fastcgi_intercept_errors on;
       }
}

Is there something I'm missing?  My blog renders correctly, but my home page on my shop won't load, it just gives a 403.  The error is:  

[error] 14045#0: *5331 directory index of "/usr/share/nginx/www/pres/" is forbidden

I currently have all my files and folders set to the proper user, and my directories and files are 777.  (It's in development)

 

I would really appreciate any help!

Edited by KosherBeefCake (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...