# Nginx for cs-cart

**URL:** <https://www.ruby-forum.com/t/nginx-for-cs-cart/212834>\
**Category:** NGINX\
**Created:** [October 14, 2011, 8:37pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834 "2011-10-14T20:37:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [October 14, 2011, 8:37pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/1 "2011-10-14T20:37:16Z")

</div>

this is for cs-cart

RewriteBase /  
RewriteCond %{REQUEST\_FILENAME} !-f  
RewriteCond %{REQUEST\_FILENAME} !-d  
RewriteRule . index.php?sef\_rewrite=1 [L,QSA]

i know one rule only

try\_files $uri $uri/ /index.php?sef\_rewrite=1;  
but i cant open those url with .html

Posted at Nginx Forum:

> **[nginx for cs-cart](https://forum.nginx.org/read.php?2,216707,216707#msg-216707)**
>
> this is for cs-cart RewriteBase / RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . index.php?sef\_rewrite=1 \[L,QSA\] i know one rule only try\_files $uri $uri/ /index.php?sef\_rewrite=1; but i c

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 14, 2011, 9:30pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/2 "2011-10-14T21:30:23Z")

</div>

On 14 October 2011 21:36, vidan [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> but i cant open those url with .html  
> That should open html files ordinarily. Do you get an error message with  
> it?

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 14, 2011, 10:15pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/3 "2011-10-14T22:15:36Z")

</div>

yes, check in the logs, bla-bla.html not found

Posted at Nginx Forum:

> **[Re: nginx for cs-cart](https://forum.nginx.org/read.php?2,216707,216715#msg-216715)**
>
> this is for cs-cart RewriteBase / RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . index.php?sef\_rewrite=1 \[L,QSA\] i know one rule only try\_files $uri $uri/ /index.php?sef\_rewrite=1; but i c

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 14, 2011, 10:40pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/4 "2011-10-14T22:40:19Z")

</div>

On Fri, Oct 14, 2011 at 04:15:00PM -0400, vidan wrote:

Hi there,

> yes, check in the logs, bla-bla.html not found

Does bla-bla.html exist?

The following nginx.conf seems to do for me what you describe you want  
(curl -v [http://localhost:8000/there.html](http://localhost:8000/there.html) gives me the content of the  
file; curl -v [http://localhost:8000/notthere.html](http://localhost:8000/notthere.html) gives me the output  
of /index.php with REQUEST\_URI set to /notthere.html)

If it doesn’t do the same for you, what is different?

===  
events {  
worker\_connections 1024;  
debug\_connection 127.0.0.1;  
}

http {  
server {  
listen 8000;  
include fastcgi.conf;  
try\_files $uri $uri/ /index.php?sef\_rewrite=1;

```
    location = /index.php {
        fastcgi_pass unix:php.sock;
    }
}

```

# }

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 14, 2011, 11:17pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/5 "2011-10-14T23:17:59Z")

</div>

On Fri, Oct 14, 2011 at 05:02:50PM -0400, vidan wrote:

Hi there,

> hi Francis, no bla-bla.html does not exist.  
> its only a redirect from url like this  
> [http://indomakeup.com/index.php?dispatch=pages.view&page\_id=11](http://indomakeup.com/index.php?dispatch=pages.view&page_id=11)  
> i could open something like this /url/  
> but can’t open url end with .html

I’m afraid that I don’t understand the problem you are reporting.

a) what do you do?  
b) what do you see?  
c) what do you expect to see?

and, if it isn’t immediately clear:

d) what is the difference between b) and c)?

> location / {  
> try\_files $uri $uri/ /index.php?sef\_rewrite=1;  
> }

My current guess is that you have another location{} block in your  
configuration that is being used instead of this one for the request  
you are making.

But without more information, it remains guesswork.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 17, 2011, 2:25pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/6 "2011-10-17T14:25:28Z")

</div>

Hello,

please do open [CS-Cart Documentation — CS-Cart 4.21.x documentation](http://kb2.cs-cart.com/seo-not-work#1)

> [@](#):
>
> DirectoryIndex index.html index.php
> 
> RewriteEngine on # Some hostings require RewriteBase to be uncommented # Example: # Your store url is http://www.yourcompany.com/store/cscart # So "RewriteBase" should be: # RewriteBase /store/cscart RewriteBase / RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . index.php?sef\_rewrite=1 [L,QSA]

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,216707,216795#msg-216795](http://forum.nginx.org/read.php?2,216707,216795#msg-216795)

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 27, 2011, 7:08am UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/7 "2011-10-27T07:08:43Z")

</div>

update pls

Posted at Nginx Forum:

> **[Re: nginx for cs-cart](https://forum.nginx.org/read.php?2,216707,217391#msg-217391)**
>
> this is for cs-cart RewriteBase / RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . index.php?sef\_rewrite=1 \[L,QSA\] i know one rule only try\_files $uri $uri/ /index.php?sef\_rewrite=1; but i c

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 14, 2011, 11:03pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/8 "2011-10-14T23:03:11Z")

</div>

hi Francis, no bla-bla.html does not exist.  
its only a redirect from url like this  
[http://indomakeup.com/index.php?dispatch=pages.view&page\_id=11](http://indomakeup.com/index.php?dispatch=pages.view&page_id=11)  
i could open something like this /url/  
but can’t open url end with .html

location / {

try\_files $uri $uri/ /index.php?sef\_rewrite=1;

}

Posted at Nginx Forum:

> **[Re: nginx for cs-cart](https://forum.nginx.org/read.php?2,216707,216718#msg-216718)**
>
> this is for cs-cart RewriteBase / RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . index.php?sef\_rewrite=1 \[L,QSA\] i know one rule only try\_files $uri $uri/ /index.php?sef\_rewrite=1; but i c

---

<div class="post-metadata">

**Author:** ![vidan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/3e96dc/32.png) [@vidan](https://www.ruby-forum.com/u/vidan)\
**Post date:** [October 28, 2011, 4:56pm UTC](https://www.ruby-forum.com/t/nginx-for-cs-cart/212834/9 "2011-10-28T16:56:55Z")

</div>

On Thu, Oct 27, 2011 at 01:08:03AM -0400, vidan wrote:

Hi there,

> update pls

a) what do you do?  
b) what do you see?  
c) what do you expect to see?

As a very specific example: when you do

curl -v [http://localhost/url.html](http://localhost/url.html)

and the file url.html _does not_ exist, what do you want to have  
happen? And what do you actually see happen?

And when you do

curl -v [http://localhost/url/](http://localhost/url/)

and the directory url _does_ exist, what do you see, and what do you  
want to see?

And when the directory url does _not_ exist, what do you see, and what  
do you want to see?

From and nginx config perspective, I’m not seeing any problems in what  
has been suggested to you.

So if you are seeing problems, and you want some help, it would be to  
your advantage to make it easy for people to help you.

All the best,

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
