Welcome! Log In Create A New Profile

Advanced

Need help to set rewrite rule in nginx

Posted by nathankmungia 
This forum is currently read only. You can not log in or make any changes. This is a temporary situation.
Need help to set rewrite rule in nginx
May 11, 2016 10:17AM
Hello,

I need help to set rewrite rule in nginx. Can anyone help me to set following rule in nginx? I have 2 files. Robots.txt and sitemap.xml that i need to rewrite. I have 2 domains both pointing to same server location having different sitemap file and robots.txt.

Domain1.com

- robots file name robots-domain1.txt
- sitemap file name sitemap-domain1.xml

Domain2.com

- robots file name robots-domain2.txt
- sitemap file name sitemap-domain2.xml

Now what i want to do is I need a rewrite rule that will show me robots-domain1.txt if i goes to http://domain1.com/robots.txt

Thanks & Regards,

Online Users

Guests: 82
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready