Bruce
Bruce

Reputation: 1

PHP strange header

Working for a friend to move her website to a new server, her developer wrote the following code as main index.php:

<?php
header("Location: /s/subdir/r/index/");
?>

On the new server it's not working. I would understand if it was header("Location: /subdir/index.php");. What purpose do the /s and /r serve? This is an old website.

Upvotes: 0

Views: 44

Answers (2)

Ivan Ponomarev
Ivan Ponomarev

Reputation: 46

Probably it depends on the server's settings (routing) or application's settings (php engine routing).

So this header will redirect your page to "/s/subdir/r/index/" it can be a real directory OR it can be query for exact php engine.

For example Yii2 has this system for routing pages: http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html

Upvotes: 0

kost
kost

Reputation: 730

This header will redirect user's browser from http://example.com/ to http://example.com/s/subdir/r/index/.

Probably /s, /r are directories/subdirectories on the old server.

Upvotes: 2

Related Questions