Jump to content

.htaccess and .htpasswd throw 404 error


pwired
 Share

Recommended Posts

Hi,

I don't want google to index a website that I am building at the moment, for obvious reasons.

The site should be indexed only, once it is completed.

I don't like to use <meta name='robots' content='noindex,follow' /> because this will stop only legitimate engines and bots

In the past I always could use a .htpasswd file and put this in the root .htaccess file:

AuthUserFile   /path/to/.htpasswd
AuthType Basic
AuthName "Identify"
Require valid-user

For some reason this seems to stop working and processwire multilanguage 2.6.1 throws a 404. I checked both .htaccess and .htpasswd for typo's, etc but can not find anything. If I remove again the 4 lines in the .htaccess file there are no errors.

Now I have been looking in the index.php and checking all over any limitations on the host but it is going to take too much time to fix this. What about Adriaan's page protector module ? Does this only work for "pages" in the backend or also for root access ? What I need is blocking the whole site with a password for all search engines indexing until the site is ready.

Link to comment
Share on other sites

Maybe the path to the ".htpasswd"-file is not correct. You can use this PHP-function to see the correct path:

echo getcwd();

Beside that you could use a "robots.txt"-file for preventing search engines to crawl your site. A subdomain would also help I think as well as hiding the root page in ProcessWire.

Link to comment
Share on other sites

I just tested this locally on my laptop with the same setup and there everything is working.

It must have something to do with the host. Maybe the host doesn't like something in the index.php


Ok MuchDev, thanks for that confirmation. I will install Adriaan's page protector module

and stop wasting more time finding some unknown server host limitation.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...