# Nginx .htaccess problem

**URL:** <https://www.ruby-forum.com/t/nginx-htaccess-problem/202555>\
**Category:** NGINX\
**Created:** [February 1, 2011, 12:42pm UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555 "2011-02-01T12:42:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [February 1, 2011, 12:42pm UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555/1 "2011-02-01T12:42:05Z")

</div>

[![](http://img843.imageshack.us/img843/3512/showk.png)](http://img843.imageshack.us/i/showk.png/)

Uploaded with [ImageShack.us](http://imageshack.us)

hi i just try to running my website on nginx i am really impressed the  
speed i have search engine script and working apache well i just made 81  
port for nginx for testing purpose i found a .htaccess converter to  
nginx after this rewrite my site %90 works except if i type michael  
autocomplate works but if i put space after michael I i get error this  
is the error i get please see picture  
i think one of command in htaccess it couldnt converted to nginx command  
my question is how can i fix this problem

apache .htaccess

RewriteEngine on  
Options +FollowSymlinks  
RewriteBase /  
RewriteRule .htaccess - [F]  
RewriteRule (._)(style.css)$ $2 [L]  
RewriteRule (._)(lightbox.css)$ $2 [L]  
RewriteRule (._)(userdata/)(._)$ $2$3 [QSA,L]  
RewriteRule (._)(maps/)(._)$ $2$3 [QSA,L]  
RewriteRule (._)(test/)(._)$ $2$3 [QSA,L]  
RewriteRule ^(._)(index.php)(/?)(._)$ index.php?page=index/$4 [QSA,L]  
RewriteRule (._)(install/)(._)$ $2$3 [QSA,L]  
RewriteRule (._)(addon/)(._)$ $2$3 [QSA,L]  
RewriteRule (._)(cron/)(._)$ $2$3 [QSA,L]  
RewriteRule (._)(js/)(._)(.js)$ $2$3$4 [L]  
RewriteRule (._)(images/)(._)(.)(gif|jpe?g|png|ico)$ $2$3$4$5 [L]  
RewriteCond %{request\_uri} !^index.php  
RewriteRule ^(.\*)$ index.php?page=$1 [QSA,L]

automatic converted  
return 403;  
break;  
rewrite /(._)(style.css)$ /$2 last;  
rewrite /(._)(lightbox.css)$ /$2 last;  
rewrite /(._)(userdata/)(._)$ /$2$3 last;  
rewrite /(._)(maps/)(._)$ /$2$3 last;  
rewrite /(._)(test/)(._)$ /$2$3 last;  
rewrite ^/(._)(index.php)(/?)(._)$ /index.php?page=index/$4 last;  
rewrite /(._)(install/)(._)$ /$2$3 last;  
rewrite /(._)(addon/)(._)$ /$2$3 last;  
rewrite /(._)(cron/)(._)$ /$2$3 last;  
rewrite /(._)(js/)(._)(.js)$ /$2$3$4 last;  
rewrite /(._)(images/)(._)(.)(gif|jpe?g|png|ico)$ /$2$3$4$5 last;  
#ignored: condition 0  
rewrite ^/(.\*)$ /index.php?page=$1 last;

myconf file is

server {  
listen 81;  
server\_name \*.mysite.ws;  
access\_log /var/log/mysite.access.log main;  
error\_log /var/log/mysite.error.log;  
root /home/mysite/www;  
index index.php index.html;

rewrite /(._)(style.css)$ /$2 last;  
rewrite /(._)(lightbox.css)$ /$2 last;  
rewrite /(._)(userdata/)(._)$ /$2$3 last;  
rewrite /(._)(maps/)(._)$ /$2$3 last;  
rewrite /(._)(test/)(._)$ /$2$3 last;  
rewrite ^/(._)(index.php)(/?)(._)$ /index.php?page=index/$4 last;  
rewrite /(._)(install/)(._)$ /$2$3 last;  
rewrite /(._)(addon/)(._)$ /$2$3 last;  
rewrite /(._)(cron/)(._)$ /$2$3 last;  
rewrite /(._)(js/)(._)(.js)$ /$2$3$4 last;  
rewrite /(._)(images/)(._)(.)(gif|jpe?g|png|ico)$ /$2$3$4$5 last;  
rewrite ^/(.\*)$ /index.php?page=$1 last;

location / {  
try\_files $uri $uri/ /index.php?q=$request\_uri;  
}

location ~ .php$ {  
root html;  
fastcgi\_pass 127.0.0.1:9000;  
fastcgi\_index index.php;  
fastcgi\_param SCRIPT\_FILENAME /home/mysite/www$fastcgi\_script\_name;  
include fastcgi\_params;  
}  
}

Posted at Nginx Forum:

> **[nginx .htaccess problem](https://forum.nginx.org/read.php?2,171260,171260#msg-171260)**
>
> \[URL=http://img843.imageshack.us/i/showk.png/\]\[IMG\]http://img843.imageshack.us/img843/3512/showk.png\[/IMG\]\[/URL\] Uploaded with \[URL=http://imageshack.us\]ImageShack.us\[/URL\] hi i just try to running my website on nginx i am really impressed the speed...

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 1, 2011, 12:42pm UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555/2 "2011-02-01T12:42:44Z")

</div>

i think there is something wrong with the space “did you mean” also  
doesnt work properly it redirect me different address

it redirect me which is not working  
[mywebsite.com/search/web&search=katy%20perry&type=web](http://mywebsite.com/search/web&search=katy%20perry&type=web)

working example is [mywebsite.com is available for purchase - Sedo.com](http://mywebsite.com/search/web?search=katy+perry&type=web)

Posted at Nginx Forum:

> **[Re: nginx .htaccess problem](https://forum.nginx.org/read.php?2,171260,171261#msg-171261)**
>
> \[URL=http://img843.imageshack.us/i/showk.png/\]\[IMG\]http://img843.imageshack.us/img843/3512/showk.png\[/IMG\]\[/URL\] Uploaded with \[URL=http://imageshack.us\]ImageShack.us\[/URL\] hi i just try to running my website on nginx i am really impressed the speed...

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 1, 2011, 12:55pm UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555/3 "2011-02-01T12:55:24Z")

</div>

i identify the error but still couldnt resolve nginx didnt replace space  
following

nginx & apache ?  
nginx % apache +

Posted at Nginx Forum:

> **[Re: nginx .htaccess problem](https://forum.nginx.org/read.php?2,171260,171266#msg-171266)**
>
> \[URL=http://img843.imageshack.us/i/showk.png/\]\[IMG\]http://img843.imageshack.us/img843/3512/showk.png\[/IMG\]\[/URL\] Uploaded with \[URL=http://imageshack.us\]ImageShack.us\[/URL\] hi i just try to running my website on nginx i am really impressed the speed...

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 2, 2011, 3:12am UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555/4 "2011-02-02T03:12:10Z")

</div>

what kind of expression that i need to write in conf file to convert &  
to ?

[www.mysite.com/search/web?search](http://www.mysite.com/search/web?search)

instead

[www.mysite.com/search/web&search](http://www.mysite.com/search/web&search)

Posted at Nginx Forum:

> **[Re: nginx .htaccess problem](https://forum.nginx.org/read.php?2,171260,171399#msg-171399)**
>
> \[URL=http://img843.imageshack.us/i/showk.png/\]\[IMG\]http://img843.imageshack.us/img843/3512/showk.png\[/IMG\]\[/URL\] Uploaded with \[URL=http://imageshack.us\]ImageShack.us\[/URL\] hi i just try to running my website on nginx i am really impressed the speed...

---

<div class="post-metadata">

**Author:** ![lifeisjustabout](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/74df32/32.png) [@lifeisjustabout](https://www.ruby-forum.com/u/lifeisjustabout)\
**Post date:** [February 2, 2011, 10:45am UTC](https://www.ruby-forum.com/t/nginx-htaccess-problem/202555/5 "2011-02-02T10:45:32Z")

</div>

thanks its been fixed

Posted at Nginx Forum:

> **[Re: nginx .htaccess problem](https://forum.nginx.org/read.php?2,171260,171485#msg-171485)**
>
> \[URL=http://img843.imageshack.us/i/showk.png/\]\[IMG\]http://img843.imageshack.us/img843/3512/showk.png\[/IMG\]\[/URL\] Uploaded with \[URL=http://imageshack.us\]ImageShack.us\[/URL\] hi i just try to running my website on nginx i am really impressed the speed...
