/    Sign up×
Community /Pin to ProfileBookmark

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

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NatdripJul 27.2012 — 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.
Copy linkTweet thisAlerts:
@DevlinauthorJul 27.2012 — 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.
Copy linkTweet thisAlerts:
@criterion9Jul 27.2012 — Sounds like you might need to look at mod_rewrite as you probably don't want to be sending 302 headers all the time.
Copy linkTweet thisAlerts:
@DevlinauthorJul 27.2012 — 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?
Copy linkTweet thisAlerts:
@svidgenJul 27.2012 — A redirect here and there can help keep things organized on the backend. But, there's not [I]typically[/I] 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[/QUOTE]


But, the first one makes sense. And after a successful login, I would expect the login page to redirect the user back to [I]MyDomain/Category/Sub-Category/Item/Write-A-Review[/I].
Copy linkTweet thisAlerts:
@DevlinauthorJul 27.2012 — A redirect here and there can help keep things organized on the backend.[/QUOTE]

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
×

Success!

Help @Devlin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.13,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...