Hey Igor,<br><br>Works great, only know it returns a 404 error with every request :( is there a way I can remove the header send by nginx?<br><br><div><span class="gmail_quote">On 12/13/07, <b class="gmail_sendername">Igor Sysoev
</b> &lt;<a href="mailto:is@rambler-co.ru">is@rambler-co.ru</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thu, Dec 13, 2007 at 09:06:05AM +0100, Abdul-Rahman Advany wrote:
<br><br>&gt; Hi guys,<br>&gt;<br>&gt; I am running php with nginx, with fastcgi. But instead of heaving my urls<br>&gt; like <a href="http://www.myblog.com/index.php/bla/bla">www.myblog.com/index.php/bla/bla</a> I would like
<br>&gt; <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a>&lt;<a href="http://www.myblog.com/bla/bla.">http://www.myblog.com/bla/bla.</a>&gt;<br>&gt;<br>&gt; With the setup at the end of the mail, it redirect if a file can&#39;t be found
<br>&gt; to index.php, but I get the content of index.php back. (So if I go to<br>&gt; <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a>).<br>&gt;<br>&gt; But I also have other requests that should not be rewritten (directories and
<br>&gt; files in the root directory). Is this possible? to redirect only if<br>&gt; <a href="http://www.myblog.com/bla/bla">www.myblog.com/bla/bla</a> doesn&#39;t exist to a normal request to the root<br>&gt; directory and send that to the fastcgi process?
<br><br>How does wordpress find what URI you request ?<br>I know that wordpress may use REQUEST_URI (it should already set<br>in /etc/nginx/fastcgi.conf):<br><br>fastcgi_param&nbsp;&nbsp;REQUEST_URI&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request_uri;<br><br>The second way (I do not know whether Wordpress use it) is PATH_INFO:
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location / {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /var/www/blog;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error_page&nbsp;&nbsp;404 /index.php;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location ~ \.php$ {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/nginx/fastcgi.conf;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_pass 
<a href="http://127.0.0.1:8888">127.0.0.1:8888</a>;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp;&nbsp;PATH_INFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$request_uri;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp;&nbsp;SCRIPT_FILENAME&nbsp;&nbsp;/var/www/blog/$fastcgi_script_name;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$ {
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /var/www/blog;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br><br><br>&gt; I really love nginx, and thanks to this mailinglist I didn&#39;t need much help.<br>&gt; But most rewrite rules are written wordpress MU (multiuser) and not<br>
&gt; wordpress redux. I just need to to rewrite all request that do not exists to<br>&gt; index.php and pass this to fastcgi.<br>&gt;<br>&gt; I did get this working one time.. but I can&#39;t figure out how I did it :S<br>
&gt;<br>&gt; server {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; listen&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;80;&nbsp;&nbsp;# Replace this IP and port with the right<br>&gt; ones for your requirements<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; server_name&nbsp;&nbsp;<a href="http://www.myblog.com">www.myblog.com</a><br>&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #charset koi8-r;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #access_log&nbsp;&nbsp;logs/host.access.log<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location ~*<br>&gt; ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov)$
<br>&gt; {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; root /var/www/blog;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; error_page&nbsp;&nbsp;404 /index.php;<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; location ~ \.php$ {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/etc/nginx/fastcgi.conf;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_pass<br>&gt; <a href="http://127.0.0.1:8888">127.0.0.1:8888</a>;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_index&nbsp;&nbsp;index.php;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp;&nbsp;SCRIPT_FILENAME&nbsp;&nbsp;/var/www/blog/$fastcgi_script_name;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # deny access to .htaccess files, if Apache&#39;s document root<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # concurs with nginx&#39;s one<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #location ~ /\.ht {<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #&nbsp;&nbsp;&nbsp;&nbsp;deny&nbsp;&nbsp;all;
<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #}<br>&gt;<br>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br>&gt;<br>&gt;<br>&gt;<br>&gt; --<br>&gt; Abdul-Rahman Advany<br>&gt;<br>&gt; IM: <a href="mailto:abdulrahman@advany.com">abdulrahman@advany.com</a><br><br>--<br>Igor Sysoev<br>
<a href="http://sysoev.ru/en/">http://sysoev.ru/en/</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Abdul-Rahman Advany<br><br>IM: <a href="mailto:abdulrahman@advany.com">abdulrahman@advany.com</a>