Script:
https://example.com/docs/index.php
In index.php, I have the following code:
header('Location: page2.php');
However, instead of opening page2.php, the following URL is opened:
https://example.com/docs/index.php/page2.php
If I put an absolute URL, everything works.
- Why is this happening?
- Is there any workaround so that I don't have to use an absolute URL?
https://example.com/docs/index.php/? btw, the location header require a complete absolute URIheader('Location: /docs/page2.php');