Forum Moderators: coopster

Message Too Old, No Replies

Passing URL as variable

         

ntbgl

12:26 am on Apr 8, 2009 (gmt 0)

10+ Year Member



I am having a hard time with this and would greatly appreciate some help.

On example1.com/file1.php I'm changing outbound links from:

<a href="<?php echo $url; ?>">...

to

<a href="http://www.example2.com/en/<?php echo urlencode($url); ?>">...

Then on my example2.com .htaccess file:

RewriteRule ^en/(.*)$ /english/index.php?url=$1 [NC]

Then on example2.com/english/index.php:

<?php echo urldecode($_GET["url"]); ?>

As that is, I get a 404 Not Found Error.

If I change

<a href="http://www.example2.com/en/<?php echo urlencode($url); ?>">...

to

<a href="http://www.example2.com/en/<?php echo $url; ?>">...

Then it kind of works, but my links look something like this:

http:/www.outboundexample.com/

Or any parameters that get passed in the url get completely ignored.

Any help is greatly appreciated!

coopster

6:19 pm on Apr 10, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Do you have anything else in your .htaccess file that may be causing your issue?