Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

109
Views
Need a way to post a url to facebook than will display html in the preview and then redirect

Need a way to post a url to facebook than will display html in the preview and then redirect to a page. The problem is that I also have a php tag that I need to pass.

Right now I'm using a normal 301 header redirect but then you cant output any html. As a result, the facebook preview of the link/page looks blank. So what I want to do is have some html output for facebook to pick up and display and interrogate what is in $search if there is anything and then redirect based on that.

<?php

$search=urlencode($_GET['search']);

if ( $search == "" )
{
$redirectlink="http://mylink";
}
else
{
$redirectlink="http://mylink$search";
}

header("Location: $redirectlink", true, 301);
exit;
?>     
over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!