Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirecting to a redirect

Status
Not open for further replies.

stabilizer

IS-IT--Management
Sep 28, 2006
1
US
Hi all,

I'm trying to make our site cleaner for search engines by eliminating ugly query strings but am running into some redirect issues. I have the following PHP code set up to link pages that are generated via a stroll throught the site:

header('location:'.$redirect);

Where redirect=
This is where it gets tricky! We then have a RewriteCond set up in our apache webserver that will take the request for /dir/id and redirect to but this is a pass through redirect so the URL in the browser should remain Apache config syntax:

# Rewrite engine
RewriteEngine on
Options +FollowSymLinks
RewriteRule ^dir\/([0-9]+)$ /page_id.php?i=$1 [PT]

Does this make sense? To basically recap, I'm using a header redirect in PHP to then call a RewriteRule in apache which redirects to another page but I want the apache redirect to happen behind the scenes and not change what is in the browser URL.

I'm running PHP 4.3.10, Apache 1.3.33 on Debian Sarge.

Thanks,

Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top