Deceased
- Join Date:
- Jan 2007
- Location:
- Australia
- Posts:
- 6,263
- Plugin Contributions:
- 4
Cannot log in after adding www. redirect to .htaccess file
lhungil:
Agreed. Thus why I said the best fix was to update the define entries in the respective configure.php files. I'm sure you have seen people do some crazy things with redirects... everything from minor performance hits all the way to the point of harming their SE ranking and website. I know I have.
Lets not forget the endless loops!
Since you mentioned performance. Just plain 'common sense' should be enough to let most people know that a redirect is always going to have a negative impact on perfomance. It's the same principle as the shortest distance between two points is a straight line.. Any detour or deviation extends the route and slow the response. Ya canna disobey the laws of physics. :)
lhungil:
However my original point is having the additional redirect (setup correctly) will not cause any harm (if Zen Cart is configured correctly).
I will dispute this (simply because I can). <smiles>. I claim it can cause harm. To accept this claim though, it needs to be acknowledged a redirect or any type comes with a performance hit. This, in my opinion is 'harm' .
Now by setting a redirect that isn't needed opens up the possibility that it could be used, which is essentially the same as telling your customers, Hey, my website can be found 'here', but if you like, you can type in this other addresses instead, that will get you to the same place, albeit a little slower because the additional DNS lookups will be required and the webserver itself will need to internal modify the request to this other address.
Why would you tell your customers this less efficient way of accessing your site? it certainly doesn't do any good, and I can only see it being harmful.
lhungil:
I also wanted to point out two cases (off the top of my head) where adding a redirect related to the FQDN may have benefit (as someone asked the question). I would be remiss if I did not point out this article on the Zen Cart website currently recommends adding the redirect and gives a reason why it may be beneficial.
One of us needs to re-read that article. It starts out be stating if you've got a problem try renaming the .htaccess file so as to AVOID the issues and problems caused by redirects. Clearly, even the zen team know rewrites cause more problems than they solve.
Were you perhaps referring to:
If you are using "www." in your URL on one page and not using "www." in the URL on another page, you may have problems.
Well, yes, this is true, but this should never happen. It is bad configuration (or bad codeing), and rewriting from one to the other (or vice verci) is a means of mitigating this problem, but as I have stressed so many times before, it is the 'wrong' fix for the problem.
lhungil:
Or you may want to "help" any users who are typing your website into the address bar.
Do people still do this? I can't remember the last time typed anything in my address bar (well, perhaps a few characters, just enough to get the history expansion working. The rest of the time I'm just plain lazy (like most people, I assume) and just use the SE links after entering my search query.
lhungil:
Of course canonical links also provide this information to SEs (and are already present in current versions of Zen Cart) and help stop most SEs from considering "www.yoursite.com" and "yoursite.com" as duplicate content / separate websites.
Which is so very, very wrong. :(
"www.yoursite.com" and "yoursite.com" should be (and technically are) different sites, even if they do serve duplicate content.
lhungil:
Browsers typically do not care about duplicate URLs.
Err, mmmm, sorry, what exactly is a 'duplicate URL' again?
lhungil:
In my experience when you want to change the URL shown / linked to from a SE (I will not claim to be an expert) 301 redirects tend to be picked up faster by SEs than canonical links.
With good reason.. server response vs content parsing. 301's are designed for an instant response. Content parsing take place at a more leisurely pace so as to help avoid overload your server (The Yandex spider excepted, but that's a whole nother topic).
lhungil:
If you really want to know more I can explain the use cases in a PM. But I know you are a bright person (who is also good at debating) and can probably figure most of these out. They do not apply to the OPs problem.
Thanks for the offer to explain more, but for the most part we seem to both be on the same track (although to the casual reader it may not seem that way).
I'm pretty much nitpicking, mainly in regards to the perfomance hit that will occur with any redirect/rewrite. Oftentimes the benefits outweigh the losses, but more often than not, the gains aren't to be made, and to suggest the use of them because 'they cause no harm' isn't a compelling reason, when the harm is caused, its just that most aren't aware of it.
Cheers
Rod
ps. I've enjoyed (am enjoying) this discussion. :)