Wordpress + htaccess

wordpress

#1

i have a wordpress installation in a htaccess protected directory. all was fine with the world until it broke one day. honestly i don’t think i did anything- i dont remember tweaking the settings.

the problem is that the wp site is blank. after logging into the htaccess, i get blank pages for the homepage and for the wp-admin page. if i delete the htaccess protection it comes back.

i was doing the htaccess protection automagically through dreamhost, when i had problems i created it manually- same problem. i think in the process of my troubleshooting i upgraded wordpress.

how can i get htaccess to work again? anyone have ideas as to how i broke it? thanks!


#2

Are you using protection for a group or just for yourself (eg. to avoid spiders in a dev situation)?

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

its for a group of people but we are all going to use one username / password combo


#4
  • Log in to your shell and type: htpasswd -c wpallow [color=#00CC00][username][/color]

^ substituting [username] for the communal username

You’ll be asked to input, then verify, a password for [username].

  • In your WP directory’s .htaccess file, add:

AuthType Basic AuthName "Restricted Access" AuthUserFile /home/[color=#0000CC][user][/color]/wpallow Require valid-user ^ substituting [user] for your shell username

You can add more user/pass combos in shell if you like:

htpasswd wpallow [username2]
htpasswd wpallow [username3]

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

just followed your instructions, and i have the same problem.

with the added portion of the HTACCESS file, it prompts me for a password but then wordpress only shows up as blank pages.

when i remove the htaccess restrictions, then wordpress comes back.

on a whim, i disabled all renaming of pages (mod rewrite rules for permalinks) and it made no change.

any other ideas as to what might be causing the issue?

thanks!


#6

Try it on a completely different directory (or better yet, a subdomain) to check if Auth functions as expected. If it does, setup your WP site with nothing but the Auth lines in it’s .htaccess file and re-test.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#7

well moving it to another directory fixed it. not sure what went wrong. heres what i did

  1. created a new protected directory using the dreamhost “goodies” section.
  2. copied over all my wordpress files
  3. changed the settings page to reflect the new folder
  4. renamed the old folder to something else (ill keep it for a bit to be sure nothing else went wrong).

the htaccess works fine now. weird!