• Plans & Pricing
  • Log in
  • Get started
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress 
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Get started
  • Sign up
  • Log in
About
  • Plans & Pricing
Products
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Newsletter
  • Professional Email
  • Website Design Services
  • Commerce
  • WordPress Studio
  • Enterprise WordPress  
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • Support Center
  • WordPress News
  • Business Name Generator
  • Logo Maker
  • Discover New Posts
  • Popular Tags
  • Blog Search
Jetpack App
  • Learn more
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Search
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
Forums / htaccess help – Password protect wp-admin and wp-login.php

htaccess help – Password protect wp-admin and wp-login.php

  • Unknown's avatar
    flamesoulis · Member · May 8, 2015 at 6:03 am
    • Copy link Copy link
    • Add topic to favorites Add topic to favorites

    So I had originally managed to password protect wp-admin and wp-login.php and all was good. Then I enabled “Day and Name” Permalink and all heck broke loose. Now, one would assume the best idea is to disable it and go back to the old page system, but I would really like to keep this setup if possible.
    The issues are that the system will keep trying to redirect pages if I keep the Authentication in the folder (wp-admin). The file match for wp-login.php instead gives a “file not found” error, which means I can’t log out. If i have to go back to the page number system, I will, but if I don’t have to, that would be preferred. The reason for the password protection is to help stave off bots and attackers.

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_URI} !^/(wp-admin|wp-admin/.*)$
    RewriteCond %{EQUEST_FILENAME} !^/(wp-login.php.*)$
    #RewriteRule !^wp-login.php$ - [OR,L]
    RewriteRule ^index.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    <FilesMatch "wp-login.php">
    	RewriteEngine Off
    	AuthType Basic
    	AuthName "WP-Admin"
    	AuthUserFile "/home/flame18/.htpasswds/public_html/wp-admin/passwd"
    	require valid-user
    </FilesMatch>

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar
    doncharisma · Member · May 8, 2015 at 6:15 am
    • Copy link Copy link

    @flamesoulis – You’re on the wrong forum, you need the wordpress.org support forums …

    On it’s footer your blog says :

    “Proudly powered by WordPress. Theme: Flat 1.5.7 by YoArts. “

    Mine says :

    “Blog at WordPress.com. | The Titan Theme”

    So please use the wordpress.org forums for your question – https://wordpress.org/support/

    Cheers

    Don Charisma

  • Unknown's avatar
    flamesoulis · Member · May 8, 2015 at 6:17 am
    • Copy link Copy link

    Woops! Many thanks.

  • Unknown's avatar
    doncharisma · Member · May 8, 2015 at 6:20 am
    • Copy link Copy link

    PS this page explains the difference – https://en.support.wordpress.com/com-vs-org/

    Aside the official page, my own explanation of differences between wp.com and wp.org here – http://doncharisma.org/2014/06/22/why-choose-wordpress-for-web-development/

    Hopefully wp.org support forums will be able to help :)

    Cheers

    Don Charisma

  • The topic ‘htaccess help – Password protect wp-admin and wp-login.php’ is closed to new replies.

Tags

  • .htaccess
  • help
  • not a wp.com site
  • password
  • wordpress.org
  • wp-admin
  • wp-login.php
  • wp.org?

About this topic

  • In: Support
  • 2 participants
  • 3 replies
  • Last activity 11 years
  • Latest reply from flamesoulis

Couldn't find what you needed?

Contact us

Contact us

Get answers from our AI assistant, with access to 24/7 expert human support on paid plans.

Browse our guides

Browse our guides

Find step-by-step solutions to common questions in our comprehensive guides.

WordPress.com

Products
  • WordPress Hosting
  • WordPress for Agencies
  • Become an Affiliate
  • Domain Names
  • AI Website Builder
  • Website Builder
  • Create a Blog
  • Professional Email
  • Website Design Services
  • WordPress Studio
  • Enterprise WordPress
Features
  • Overview
  • WordPress Themes
  • WordPress Plugins
  • WordPress Patterns
  • Google Apps
Resources
  • WordPress.com Blog
  • Business Name Generator
  • Logo Maker
  • WordPress.com Reader
  • Accessibility
  • Remove Subscriptions
Help
  • Support Center
  • Guides
  • Courses
  • Forums
  • Contact
  • Developer Resources
Company
  • About
  • Press
  • Terms of Service
  • Privacy Policy
  • Do Not Sell or Share My Personal Information
  • Privacy Notice for California Users
DeutschEspañolFrançaisBahasa IndonesiaItalianoNederlandsPortuguês do BrasilSvenskaTürkçeРусскийالعربيةעִבְרִית日本語한국어简体中文繁體中文English

Mobile Apps

  • Download on the App Store
  • Get it on Google Play

Social Media

  • WordPress.com on Facebook
  • WordPress.com on X (Twitter)
  • WordPress.com on Instagram
  • WordPress.com on YouTube

Automattic

Automattic
Work With Us
    • WordPress.com Forums
    • Sign up
    • Log in
    • Copy shortlink
    • Report this content
    • Manage subscriptions