Author Topic: FrontEndLogin Script - keep visitors and google away when building your site  (Read 3291 times)

Offline sky writer

  • Posts: 926
Ruud created a great script featured here - http://wbhelp.org/tips-and-tricks/2014/keep-visitors-and-google-away-when-you-are-building-your-website/

I've used it on many sites and it really helps with the proofing process with clients.  I have noticed that after I successfully enter the password and see the site, I am met with the password screen again when I click on a menu item.  It's never bothered me, but I have a client who has become annoyed with constantly having to enter the password twice each time he reviews the site.  I know, what a hardship this must be.  But he has asked if this can be fixed.  I really don't know what might be causing the behaviour.

If Ruud or anyone else could give a suggestion, it would be greatly appreciated.

Offline Ruud

  • Posts: 3660
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Maybe it is like this:

A successfull login is kept by storing a value in a session variable.
If you login in domain.tld and the menu is pointing to www.domain.tld it will ask the question again because a new session is created.

If this is the case, you can force the visitor to go to www.domain.tld by using a few .htaccess lines:
(if you are using shorturl put it above the shorturl lines)
Code: [Select]
RewriteEngine On
# rewrite host to include www
RewriteCond %{HTTP_HOST} !^www\.               [NC]
RewriteCond %{HTTP_HOST} ^([^.]+\.[a-z]{2,6})$ [NC]
RewriteRule ^(.*)$       http://www.%1/$1      [R=301,L]