0

My clients wordpress websites is serving many 404 requests. After checking I could see that the 404 URLs are like

/wp-content/uploads/2015/8/a.png&_nc_hash=ASsvdeeknbhs

and it throws 404 error. But if we add a '?' after that filename, it will show the content. the working url was like

/wp-content/uploads/2015/8/a.png?&_nc_hash=ASsvdeeknbhs

How to set this redirection in nginx ? Please help me to achieve above redirection. Any good recommendations would be appreciated.

Anto
  • 139
  • 6
  • 1
    You should find out which part of the website generates these invalid URLs in the first place. Adding a redirect to fix this issue makes it simply more complicated. – Tero Kilkanen Dec 20 '16 at 02:53
  • Thank you. I have been looking for a temporary/immediate fix. – Anto Dec 20 '16 at 05:22

1 Answers1

0

I have been looking for a temporary/immediate fix. The following redirection rules helped me.

rewrite ^(.*)&_nc_eui2(.*)$ $1?&_nc_eui2$2 permanent;
rewrite ^(.*)&_nc_hash(.*)$ $1?&_nc_hash$2 permanent;
rewrite ^(.*)word(.*)$ $1newwordOLDWORD$2 permanent;

I hope it would help someone. :)

Anto
  • 139
  • 6