Link to home
Start Free TrialLog in
Avatar of joshky
joshky

asked on

Correct PHP code for hidden frame-based redirection (sent from htaccess)

Expanding on my original question, although the .htaccess redirect works, I'd like to redirect to a PHP document within the same domain and have it mask the redirection.

So, what I'd like to do is take:

RewriteRule ^t/([0-9]+)  http://otherdomain/tickets/$1  [R=301,NC]
RewriteRule ^e/([0-9]+)  http://otherdomain/entries/$1  [R=301,NC]

change them to

RewriteRule ^t/([0-9]+)  http://mydomain/rd.php?type=t&num=$1  [R=301,NC]
RewriteRule ^e/([0-9]+)  http://mydomain/rd.php?type=e&num=$1   [R=301,NC]

What I need is a working "rd.php" to handle a redirected request of this nature and then generate a frame-based redirect page sending the user to http://otherdomain/{type}/{num}

I have a version partially hacked together, but it's probably better than I refrain from posting and let someone whip one up in 30 seconds...

Thanks in advance!
Josh
Avatar of virmaior
virmaior
Flag of United States of America image

i'm not sure what you mean by frame-based redirect...

do you mean:
(a) the frame causes the web browser to navigate to the other page (thereby closing the current page)?
(b) the frame opens the new page and remains framed within the other?


if you want the frame to cause a 301 redirect, then this will only affect the frame itself and not the entire page including the browser bar.
Avatar of joshky
joshky

ASKER

Sorry about the confusion.  Basically, the HTML outside of the normal headers would be:

<frameset rows="100%,*" border="0">
  <frame src="http://otherdomain/tickets/$1" frameborder="0" />
  <frame frameborder="0" noresize />
</frameset>
ASKER CERTIFIED SOLUTION
Avatar of virmaior
virmaior
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of joshky

ASKER

Worked great... Thanks!