Targeting homepage (not sub pages/dirs/)

Lorenzo Raffio multiformeingegno at gmail.com
Fri Jan 17 17:40:37 UTC 2014


What should I add to this directive to target also the home page (root of
the website, e.g. website.com)?
I already have 'index.php' in the directive but what if I visit
website.com(without /index.php)?

if ($request_uri ~*
"(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)")

I think I need to add another if, this time not with ~* though but with =
Something like

if ($request_uri = "(/)")

..?

Thanks in advance!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20140117/19f3288f/attachment-0001.html>


More information about the nginx mailing list