News:

Looking for documentation? Take a look on our wiki

Main Menu

State Dropdown NGINX (rewite issue) index.php

Started by datagroove, September 29, 2014, 04:16:00 AM

Previous topic - Next topic

datagroove

With "Search Engine Friendly URLs" and "Use URL rewriting" both set to NO, the checkout state dropdown works, However if I set them to yes, and it does not work.

Looking at the console log, i see a 404 for the call to
https://example.com/component/virtuemart/user/index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=223

I am using NGINX with a suggested nginx configs for joomla:  http://docs.joomla.org/Nginx

if i call that url in the browser I get a 404, BUT if i remove the index.php from the url it works!

Question: I either need to edit the source code (not ideal) and remove the index.php from the AJAX request url, OR come up with a better NGINX config. Any suggestions?


Virtuamart  2.6.10
Joomla 2.5.19

datagroove

as a temporary fix, i edited the vmsite.js file, line 40 (removing index.php)

from
$.getJSON('index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax,

to
$.getJSON('?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax,


b.dokimakis

#2
location /component/virtuemart/user/index.php {
                if ($http_x_requested_with = XMLHttpRequest) {
                        rewrite ^(.*)/\index.php(.*)$ $1$2 last;
                }
        }