Nginx: How To Redirect /index.php To / To Avoid Content Duplication

Nginx: How To Redirect /index.php To / To Avoid Content Duplication

Note: This article will be emailed to your friend.

Normally any website that responds to /index.php also responds to /. This has the potential to duplicate content. So how can you re-direct /index.php to / without causing infinite loop in nginx?
Here is a simple solution:

if ($request_uri ~* “^/index.php\??$”) {
rewrite ^.*$ http://$host? permanent;
}

It redirects any url with /index.php or /index.php? at [...]

Read the rest of this article (77 words)

Please fill in the following fields

* - Required

Your Name: *

Your E-Mail: *

Your Remarks:

Friend's Name: *

Friend's E-Mail: *

Protected by Comment Guard Pro