Welcome! Log In Create A New Profile

Advanced

Subdirectory still redirecting to www. despite rule

Ian M. Evans
September 18, 2012 08:28PM
This issue is connected to the threads

rewrite to www EXCEPT for one directory
(http://www.ruby-forum.com/topic/4405551) and

Nginx location rule for Wordpress Multisite in subdirectories
(http://www.ruby-forum.com/topic/4405180)

After making the changes to my nginx.conf. I reloaded the config. After
going to example.com/blogs/wp-admin/install.php the browser still
redirected to www.example.com/blogs/wp-admin/install.php

Here are the applicable lines in the conf:

server {
server_name example.com;
listen 80;

location / {
return 301 http://www.example.com$request_uri;
}

location ^~ /blogs {
try_files $uri /blogs/index.php?q=$uri;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:10004;
}
}
if ($uri ~ (/blogs/[^/]*)) {
set $blogname $1;
}
location ^~ /blogs/$blogname {
try_files $uri $blogname/index.php?q=$uri;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:10004;
}
}
}

I'm wondering if it's an error in combining the config advice for the two
separate issues in the two threads.

Thanks.

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Subdirectory still redirecting to www. despite rule

Ian M. Evans September 18, 2012 08:28PM

Re: Subdirectory still redirecting to www. despite rule

Ensiferous September 18, 2012 08:36PM

Re: Subdirectory still redirecting to www. despite rule

Ian M. Evans September 18, 2012 09:06PM

Re: Subdirectory still redirecting to www. despite rule

VBart September 19, 2012 03:22AM

Re: Subdirectory still redirecting to www. despite rule

Ian Evans September 19, 2012 04:02AM

Re: Subdirectory still redirecting to www. despite rule

António P. P. Almeida September 19, 2012 05:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 135
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready