0

In Nginx I simply need a rule so any body goes to www.example.com/index.php/admin/ should automatically redirected to www.example.com/admin/

I tried different settings but all of them are for redirecting any URL containing .php in middle while I just need it only for particular admin URL

1 Answer 1

0

If you only need a redirection for a single specific URL, you can use location with the '=' modifier, as stated in the Nginx documentation.

location = '/index.php/admin/' { return 301 http://www.example.com/admin/; } 
2
  • That is correct, but it is just working for www.example.com/index.php/admin/ exclusively... while for anything like www.example.com/index.php/admin/page1/page2/ it does not work! Commented Oct 7, 2017 at 17:19
  • 1
    Well, you told in your question that you need it for a single URL, which the answer told how to do.. The URL in your comment is another URL... Commented Oct 8, 2017 at 10:28

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.