hi , i am new to this.. i am stuck in a big problem for many days. in my website.. on the main page.. there is a link to view the arabic conversion of tat site. now the link is working..when i click the link, it is directed to index.php.. tats ok.. but wat i need is.. suppose my site is test.com am on test.com/hope.php.. wen i click the link it should direct to test.php of arabic.. like tat it should link to the corresponding pages.. somebody pls give me a solution... hope u r clear...
<?php header('HTTP/1.1 301 Moved Permanently'); header('Location: http://www.test.com/test.php'); die(); ?>
thank u for the above replies www.test.com and www.test.com/ar both these are mirror sites.. if i am in the carrer.php page of test.com , and if i click the link to the mirror site, it should direct to carrer.php of test.com/ar <a href="ar/index.php"><img src="arabic.gif" border="0" alt="" /></a> this is the line of code.... whenever i click yhr link to test.com/ar, it is only directing to index.php.. hope my question is clear.. help me pls....
well it should not link to "ar/index.php" ... you should use php to read the current url and then create the link to the ar page .. <a href="ar<?php echo $_SERVER['REQUEST_URI']; ?>"><img src="arabic.gif" border="0" alt="" /></a> HTML: the $_SERVER['REQUEST_URI'] ( http://gr.php.net/manual/en/reserved.variables.server.php ) command returns the current url. so what we do is add it to the ar subfolder and it would redirect to the same page in the ar site hope this helps
thanks a lot... tried the code... but the same as before is happening... the link to the mirror site is directing only to index.php ie if i am in test.com/post.php or in test.com/xxx.php , the link is directing only to index.php. y is it so? wat change should i make? thanks for ur help..
hmm.. cant see why the above code would not work.. can you create a new .php page with only <?php echo $_SERVER['REQUEST_URI']; ?> PHP: and call it to see if it displays anything ?
<a href="ar<?php echo $_SERVER['REQUEST_URI']; ?>"><img src="arabic.gif" border="0" alt="" /></a> i tried the code once more.. now it is displaying " Requested document not found"
thanks ... tried creating a new.php page and directed the link to new.php.. it is displaying /new.php i couldnt find the mistake.. can u pls help me?? thanks for ur help..
are you including another page which holds the link to the arabic version ? if so what is the name of that page, and what is the code you use to include it ?
all the arabic html files are saved in a folder 'ar' . php pages are common for both english and arabic html files . www.test.com/index.php is the link to english site and www.test.com/ar/index.php is the link to arabic site. hope u r clear.. thanks...
hmm ... not sure of your system so i am not sure i can really help .. here goes my last attempt.. (it is very primitive because i am not a php coder.. just messing with it ..) <?php if ( isset( $_SERVER['HTTP_REFERER'] ) ) { $ref = $_SERVER['HTTP_REFERER']; // check if we come from same domain and english version $strdomain = "gulfnav.com/"; $strardomain = "gulfnav.com/ar/"; if ( stripos($ref, $strdomain) !== false && stripos($ref, $strardomain) === false ) header( str_replace($strdomain, $strardomain, $ref ) ); } ?> PHP: put this at the very top of your /ar/index.php file hope this works ..
thanks a lot for ur help.. tried ur last attempt..that too didnt work... will try some other way... i have got some other doubt.. i have a function in php for sending emails.. whenever i send just one mail from the php page to my email id.. i am receiving 3 or 4 mails... y is it so? pls giv a solution...