Forum Moderators: coopster

Message Too Old, No Replies

301 redirect https ==> to http

PHP or .htaccess?

         

spina45

5:21 pm on Apr 19, 2007 (gmt 0)

10+ Year Member



All pages on my site can be served up either using http or https. I’d like to all non-ecommerce pages to be served only via http.

I’m not a programmer but from what I’ve read it seems like some .htaccess redirect code would do the trick.

My developer is telling me he is going to create a list of all pages that are allowed to be opened via https and redirect all the rest to http using php coding and not using .htaccess.

Does this sound like the best way to do this?

Thank you.

cameraman

5:58 pm on Apr 19, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're right, you can do it either way. Unless there's some discernable pattern to the file names that you can use to your advantage or you group the files by directory, "some .htaccess redirect code" becomes a list with each file listed explicitly.

If you consider only the top/first request for a page, I think performance claims could be made for either method and ultimately could only be proven through testing. However, when you consider that almost all web pages include graphics and other such support files, I'm pretty sure php can pull ahead on overall performance because the (and someone correct me if I'm wrong) .htaccess rules are going to be run for every file request needed to render the page - the php method will only spend time examining the top-level 'container'.

I'd go with the php method on this one.