I have a webite in which page is simply redirecting by giving page name in url.i need to avoid this redirection.can u please suggest me
eelixduppy
2:01 pm on Nov 30, 2011 (gmt 0)
Hi and Welcome to WebmasterWorld!
Can you please elaborate on your problem, I am having trouble understanding what you mean. Do you know how the page is redirecting?
deepthi
6:06 am on Dec 1, 2011 (gmt 0)
Hi,
I am doing a website.fr ex:http://www.abc.com/index.php.i ve so many pages in between index and page3.php.(index,page1,page2,page3.php)if i give page2.php in the web browser like [abc.com...] is showing page2.php without having index and succeeding pages.i need to avoid that redirection.since i need to pass through all the pages and then page2.php.
how can i do this?whether i ned to keep pages in session r cookies?if so hw can i implement this?can u please guide me?
Thanks
lucy24
8:38 am on Dec 1, 2011 (gmt 0)
Still bewildered. Are you saying that when you request page2.php, it shows page2.php as requested? It sounds as if you are complaining because you are not being redirected.
What do you mean by "pages in between"? Do you mean that users are only supposed to see page2 if they have come directly from page1, and can only see page3 if they come from page2?
Cookies are probably your only fix-- but then you have to think about site visitors who don't allow cookies. You then have to tell them that they can only move on to page1 and later pages if they have cookies enabled.
It could be done in htaccess, but then you'd have a similar problem with users whose browser or IP doesn't send a referer.
:: setting aside the whole question of whether this is a good idea at all, and how the site will deal with search engines ::
I don't think you should use sesssion cookies unless every single page changes dramatically from day to day or hour to hour. If people have to leave in the middle of page2, you want them to be able come back later and continue where they left off, even if it's a few days later.
deepthi
9:34 am on Dec 1, 2011 (gmt 0)
Hi
I am having one booking website where the user has to fill all the pages for booking.we have 5 pages namely index,landing,driver,payment and at last confirm page.user has to fill first index then landing,then driver,payment and last confirm pasge.this is the flow.in the website url [abc.com...] ll show index page and user fills that form.next if the user type in url [abc.com...] by removing index,without completing driver and landing page it should redirect to index page.
lucy24
9:59 am on Dec 1, 2011 (gmt 0)
Ah, gotcha. In that case you are right: session cookies. But don't forget to make a way for users to go back and change something on page2 without having to re-enter all the information on pages 3-5.
You may not even want to use page-number parameters as part of the URL. If you have a single URL that means "booking form" or "reservation", users who enter that URL will automatically be taken to the front page. And then pull up the cookies to move from one "page" to the next. They're not really separate pages, they're just separate blocks of information.
deepthi
10:07 am on Dec 1, 2011 (gmt 0)
Thanks for the reply
those are 5 different php pages each page have submit button.on click on submit through post['submit'] and header(location:next page).this is the logic i used.nw can u please give a lines of code to complete this
deepthi
5:16 am on Dec 2, 2011 (gmt 0)
Hi,
I got solution for this
$ip=$_SERVER['HTTP_REFERER'];
this ll print previous page url
if($ip=="")
{
header('location:index.php');
}
Thanks
lucy24
6:20 am on Dec 2, 2011 (gmt 0)
Hee, hee. That's funny, because just hours ago I was looking up something about javascript and found that it, too, can retrieve both your previous page-- in fact your whole history-- and your referrer. (They spell it right.) If you've got more than one option, there's more than one chance to make sure all your customers are covered.
g1smd
2:42 pm on Dec 2, 2011 (gmt 0)
Your header returns a 302 redirect. Do you need a 301?