dmr07
dmr07

Reputation: 1478

Nginx Redirect not working for more than one parameter

I'm trying to prefix queries with www using nginx.

Problem: While domain.com and domain.com/about gets prefixed with www, domain.com/c/3kl239zz doesn't (at least it's not displayed in the browser bar).

Here are the nginx blocks:

# redirect block
server {
  listen                  80;
  server_name             domain.com;
  return                  301 https://www.domain.com$request_uri?;
}

# website block
server {
  listen                  443 ssl;
  server_name             www.domain.com;

  ...
}

Additional info:

Upvotes: 1

Views: 68

Answers (1)

Himanshu sharma
Himanshu sharma

Reputation: 7901

there is no problem with nginx . domain.com/about means domain.com with about state but where you are typing domain.com/c/3kl239zz this means domain.com with c folder with 3kl239zz state , got it. if you want this data you can give it in params domain.com/c?id=3kl239zz

Upvotes: 1

Related Questions