Tag: www

  • Cancel Prompt for htpasswd htaccess displays website

    Searching for a topic like “Cancel Prompt for htpasswd htaccess displays website” generally gives a lot of results with unrelated information and this one was not an exception. Plenty of instructions on ‘how to configure’ but relatively few on what to do if it fails.

    The cause of this dilemma was that a CPanel configuration for Directory Privacy was displaying the protected website home page if Cancel was selected 3 or more times when the htaccess password prompt was displayed.

    Directory Privacy, the CPanel interface option for configuring htaccess and htpasswd files for Apache websites, provides a ‘user friendly’ method to add specific user names and passwords to block public viewing of a website via a web browser.

    In this instance my search terms eventually led me to this explanation https://core.trac.wordpress.org/ticket/42120 which is credited to a number of others for the solution.

    To keep it simple, if you are experiencing a web page that is meant to be protected by .htaccess / .htpasswd, but it is being displayed if the Cancel option is selected at the password prompt, then check your .htaccess rule.

    1. Edit the .htaccess file in your home folder or website root (assumes that it is the whole site being protected)
    2. Find the line RewriteRule . /index.php [L]
    3. Replace with RewriteRule ./ /index.php [L]

    This worked in my case and as always your mileage may vary.

  • Using WWW or your naked Domain Name

    Using WWW or your naked Domain Name is something that has been a hot topic for debate over a number of years.

    The literal or naked domain is the domain name that you probably use in your email address to the right of the @ symbol. Like wrenmaxwell.com.au

    Personally, I have always tried to use and recommend that default business web sites should have www. Using the domain name only just creates issues with Domain Name Service management, particularly when the website resides on a server separate from other services for the same domain, like email. This view is supported by this response to the question at ServerFault https://serverfault.com/questions/145777/what-s-the-point-in-having-www-in-a-url

    http://www.yes-www.org/why-use-www/ presents an excellent review of the main reasons and I will not repeat them here.

    Suffice to say,

    • YES, use www.yourdomain as your website URL
    • AND, make that your preferred address for Google / Bing webmaster tools
    • AND, redirect your naked domain so that end users who enter your domain name manually get redirected to www. This is important to ensure that you do not have duplicated content references to your pages.
    • AND, finally, get an SSL / TLS certificate installed so that you are using https:// for your website