Jump to content

Redirection problem php NEED SOME HELP PLS ???


sinisa

Recommended Posts

Hi
I have auction script that I am working on, and I need some help with redirection.
I would like to redirect page like www.mydomain.com/item.php?id=12345 to www.mydomain/NEWDIRECTORI/item.php?id=12345
(Note that item.php?id=12345 is a some item that has been listed on that auction)
I did try to use .access file but I can not get it to work on individual item redirection it only works to redirect item.php and than redirects all items listed on auction to new directory not just one item that I want to redirect.
Thanks sinisaarijana@blic.net
Link to comment
Share on other sites

[quote author=dymon link=topic=111481.msg451831#msg451831 date=1160828018]
You can try to use a redirection like this:

header ("LOCATION: NEWDIRECTORI/item.php?id=12345");

If I remember right you can not use a full URL(www.mydomain/NEWDIRECTORI/item.php?id=12345), in security reason.
[/quote] Where do I insert this in what page?
Thanks
Link to comment
Share on other sites

[quote author=dymon link=topic=111481.msg451836#msg451836 date=1160829330]
You should use this before any printing functions like: print, echo. Otherwise you willl get an error saying that the headers allready sent.

You could provide a piece of code where you want this redirection
[/quote]

Hi thanks for the reply s
The real url of the page is http://ebajba.com/item.php?id=61d1e471ff8cf866a17a188ef5293a23
but I need this page redirected to http://www.ebajba.com/phonauct/item.php?id=61d1e471ff8cf866a17a188ef5293a23

Which page would you like me to send the code from?
Thanks
Link to comment
Share on other sites

Did I understand ritght, you want this redirection from the PHP file or from somewhere else?

If from the file than provide the code for the first url (http://ebajba.com/item.php?id=61d1e471ff8cf866a17a188ef5293a23), and indicate where the redirection should be.

Or you want just a simple redirection, like if someone enters here url (http://ebajba.com/item.php?id=61d1e471ff8cf866a17a188ef5293a23), automaticaly to be redirected here  url(http://www.ebajba.com/phonauct/item.php?id=61d1e471ff8cf866a17a188ef5293a23)? If so just live the page item.php empty, just write in it:
header ("LOCATION: NEWDIRECTORI/item.php?id={$_GET['id']}");

And this should work.
Link to comment
Share on other sites

[quote author=dymon link=topic=111481.msg451838#msg451838 date=1160830161]
Did I understand ritght, you want this redirection from the PHP file or from somewhere else?

If from the file than provide the code for the first url (http://ebajba.com/item.php?id=61d1e471ff8cf866a17a188ef5293a23), and indicate where the redirection should be.

Or you want just a simple redirection, like if someone enters here url (http://ebajba.com/item.php?id=61d1e471ff8cf866a17a188ef5293a23), automaticaly to be redirected here  url(http://www.ebajba.com/phonauct/item.php?id=61d1e471ff8cf866a17a188ef5293a23)? If so just live the page item.php empty, just write in it:
header ("LOCATION: NEWDIRECTORI/item.php?id={$_GET['id']}");

And this should work.
[/quote]

I need that simple redirection but I can not live it empty, as there is only one item.php file and the id?=12345 (I get once I create new auction)
Please note that is one item that is listed in two different directories but it comes from one DB but difference between those directories is in (template_item_php.html file) as on firestone users can bet on item for free but on second one it is not for free
Link to comment
Share on other sites

I am a bit confused on what you want to do. Try to explain with more details and some examples, because I don't understand where you want this redirection. Try the code I wrote you in a blank page and see how it works and if it can help you.

Regards
  Dymon
Link to comment
Share on other sites

[quote author=dymon link=topic=111481.msg452042#msg452042 date=1160894731]
I am a bit confused on what you want to do. Try to explain with more details and some examples, because I don't understand where you want this redirection. Try the code I wrote you in a blank page and see how it works and if it can help you.

Regards
   Dymon
[/quote]

Hi, it is bit confusing but here I will try to explain
I have auction web site www.ebajba.com  but also I have created new directory www.ebajba.com/phonauct  Now both of those sites have the same users, files, settings, itc… as the second site is just a copy of the first one and both sites are based on one DB directory. Now in second site I have created some modifications in the template_item_php.html file so when users try to bet on item they will have to pay for it as on the first one this function is for free. But none of these users do not know that second page exists. The thing that I want to do is that on some auctions on my first site I can set redirection so when user clicks on some item auction so that he can see its description I would like to redirect him to that the same item but on second page so if he wants to place bet on it he would first have to pay. So my problem is how to set up redirection of some item description page to its description on second site. I did try htacces file but it is not functioning for some reason
My htaccess file is:
RewriteEngine on Redirect item.php?id=dbc3cf805a08599972f031e6a7f21a95 http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95

Regards
Sinisa
Link to comment
Share on other sites

[quote author=dymon link=topic=111481.msg452163#msg452163 date=1160933916]
Hi,

you could use JavaScript for this:

[code]<a href="#" onClick="location.href='http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95'">The item you need</a>[/code]

try to use this and write the results.
[/quote]
Hi
I can not insert this script anywhere as the title of the auction or (The item you need) and its hyperlink is created automatically when user creates new auction and this link appears on many pages when users browse the site, I need something like htaccess that will work for redirection of that link no meter from which page users click on this link
Thank you
Link to comment
Share on other sites

[quote author=sinisa link=topic=111481.msg452185#msg452185 date=1160937474]
[quote author=dymon link=topic=111481.msg452163#msg452163 date=1160933916]
Hi,

you could use JavaScript for this:

[code]<a href="#" onClick="location.href='http://www.ebajba.com/phonauct/item.php?id=dbc3cf805a08599972f031e6a7f21a95'">The item you need</a>[/code]

try to use this and write the results.
[/quote]
Hi
I can not insert this script anywhere as the title of the auction or (The item you need) and its hyperlink is created automatically when user creates new auction and this link appears on many pages when users browse the site, I need something like htaccess that will work for redirection of that link no meter from which page users click on this link
Thank you
[/quote]

ANY IDEAS PLEASEEEEEE? :'(
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.