www.webdeveloper.com
Results 1 to 7 of 7

Thread: Is this normal PHP coding for ecommerce

  1. #1
    Join Date
    Jul 2012
    Posts
    6

    Is this normal PHP coding for ecommerce

    By way of introduction, I will say that I am not a PHP developer by any stretch of the imagination. Hopefully this site will change that.

    My query, however, is PHP related.

    I am working with an ecommerce site and have just completed a link analysis that has created an interesting question.

    Every item page has an option to review that item. To complete the review the visitor is directed to a "leave a review" login page.The link from the item page to the review is a 302 temporary redirect.

    Because they visitor must login, a cookie is enabled. The login page now redirects to a cookie usage page, again 302 temporary redirect.

    The link analysis shows a 302 temporary redirect for every single page - well over 700 at this stage.

    MyDomain/Category/Sub-Category/Item/Write-A-Review
    redirected to: MyDomain/index.php?main_page=login
    status code: 302 (object temporarily moved)
    linked from page(s): MyDomain/Category/Sub-Category/Item

    and

    MyDomain/index.php?main_page=login
    redirected to: MyDomain/index.php?main_page=cookie_usage
    status code: 302 (object temporarily moved)
    linked from page(s):

    So one click creates two temporary redirects.

    Is this usual coding within PHP ecommerce sites? I would like to have seen a static internal link to the review page to utilize the SEO potential. Is this possible?

    Thanks

  2. #2
    Join Date
    Jan 2004
    Posts
    484
    Redundancy of code block is usually not good programming but that doesn't matter what matters is what the cookie is used for I think that they may be using the cookie to redirect the user to the (prior)review page after the user logs in.

    but I am not sure.

  3. #3
    Join Date
    Jul 2012
    Posts
    6
    Thanks for the reply.
    I understand what you are saying about the cookie, but what I am trying to get to is this: does the link between the item page and the "send a review" page need to be a temporary redirect or can it be changed to a permanent link?

    I don't know PHP, hence the question.

  4. #4
    Join Date
    Jan 2009
    Posts
    3,346
    Sounds like you might need to look at mod_rewrite as you probably don't want to be sending 302 headers all the time.

  5. #5
    Join Date
    Jul 2012
    Posts
    6
    Yes, I thought of that as a last resort. I was thinking more of a code change. Does a link like that have to be temporary redirect or is it possible to make permanent links within the relevant PHP file?

  6. #6
    Join Date
    Jan 2007
    Location
    Wisconsin
    Posts
    2,120
    A redirect here and there can help keep things organized on the backend. But, there's not typically any need for a double redirect. And, once a user is logged in, they should be able to navigate relatively redirect-free.

    I really have no idea why this redirect would be necessary:
    MyDomain/index.php?main_page=login
    redirected to: MyDomain/index.php?main_page=cookie_usage
    But, the first one makes sense. And after a successful login, I would expect the login page to redirect the user back to MyDomain/Category/Sub-Category/Item/Write-A-Review.

  7. #7
    Join Date
    Jul 2012
    Posts
    6
    A redirect here and there can help keep things organized on the backend.
    Agreed. My understanding, in this context, is that redirects should only be used when code cannot be applied. Is that a true statement?

    I am thinking from an SEO standpoint where we aim for a number of internal links per page. 302 redirects carry no weight whatsoever with SE's.

    I think I have enough to talk to the developer.

    thanks

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles