With the setup at the end of the mail, it redirect if a file can’t be
found
to index.php, but I get the content of index.php back. (So if I go to www.myblog.com/bla/bla).
But I also have other requests that should not be rewritten (directories
and
files in the root directory). Is this possible? to redirect only if www.myblog.com/bla/bla doesn’t exist to a normal request to the root
directory and send that to the fastcgi process?
I really love nginx, and thanks to this mailinglist I didn’t need much
help.
But most rewrite rules are written wordpress MU (multiuser) and not
wordpress redux. I just need to to rewrite all request that do not
exists to
index.php and pass this to fastcgi.
I did get this working one time… but I can’t figure out how I did it :S
server {
listen 80; # Replace this IP and port with the right
ones for your requirements
server_name www.myblog.com
On Thu, Dec 13, 2007 at 09:06:05AM +0100, Abdul-Rahman A. wrote:
But I also have other requests that should not be rewritten (directories and
files in the root directory). Is this possible? to redirect only if www.myblog.com/bla/bla doesn’t exist to a normal request to the root
directory and send that to the fastcgi process?
How does wordpress find what URI you request ?
I know that wordpress may use REQUEST_URI (it should already set
in /etc/nginx/fastcgi.conf):
fastcgi_param REQUEST_URI $request_uri;
The second way (I do not know whether Wordpress use it) is PATH_INFO:
With the setup at the end of the mail, it redirect if a file can’t be
How does wordpress find what URI you request ?
}
^.+.(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)$
index.php and pass this to fastcgi. #access_log logs/host.access.log
location ~ .php$ {
#
There seems to be an other problem, it doesn’t pass the params so… blog.domain.com/?page_id=2 doesn’t work, where blog.domain.com/index.php?page_id=2 does work, I added both
requirest_uri
and path_info, but no success. Can’t find much on it on the mailinglist.
On Sat, Dec 15, 2007 at 07:37:00PM +0100, Abdul-Rahman A. wrote:
There seems to be an other problem, it doesn’t pass the params so… blog.domain.com/?page_id=2 doesn’t work, where blog.domain.com/index.php?page_id=2 does work, I added both requirest_uri
and path_info, but no success. Can’t find much on it on the mailinglist.
On Sat, Dec 15, 2007 at 09:45:25PM +0300, Igor S. wrote:
On Sat, Dec 15, 2007 at 07:37:00PM +0100, Abdul-Rahman A. wrote:
There seems to be an other problem, it doesn’t pass the params so… blog.domain.com/?page_id=2 doesn’t work, where blog.domain.com/index.php?page_id=2 does work, I added both requirest_uri
and path_info, but no success. Can’t find much on it on the mailinglist.
HonDev’s regex rewrite doesn’t work for me. I found a few other sites
that list the same or slightly modified rewrite rule. After 10 hours
trying to figure out wtf the problem was (I just installed and started
using nginx today) I realized it had to be the rewrite rule so I
examined it more closely. Below is the rewrite rule that works for me
with
Wordpress 2.3.1
nginx version: nginx/0.5.34
Make sure you clear your cache after changing the rewrite rule.
if (!-e $request_filename) {
rewrite ^(.*)$ $1/index.php last;
If anyone wants to see my nginx.conf I can post it here. Also, if the
rewrite rule works for you please reply and let me know. Thanks!