Reputation: 4161
I am trying to get my website to redirect to
www.domain.tld/folder/
from
www.domain.tld/folder/index.php?params=blah¶m2=etc
I have tried:
header("Location: /")
But all it does is redirect me to
www.domain.tld
Does anyone know how to redirect properly to just the folder?
Upvotes: 2
Views: 118
Reputation: 518
Just to clarify the above answer you can place check for query string in the index.php as
<?php
if ( ($_GET['params'] == 'blah') && ($_GET['param2'] == 'etc') ) {
header("location: ./");
exit;
}
?>
Upvotes: 1
Reputation: 3552
header("location: ./");
will do the job, but you will face infinite redirection because of index.php if there is no if
condition for specific case such as ?params=blah¶m2=etc
Upvotes: 4