cloudwafercloudwafer
  • Home
  • Knowledge Base
  • Products
    • Web Hosting
    • Dedicated Server
    • Domain
    • Cloud DNS
  • faqs
  • Client Area
  • Get Support
  • Home
  • Knowledge Base
  • Products
    • Web Hosting
    • Dedicated Server
    • Domain
    • Cloud DNS
  • faqs
  • Client Area
  • Get Support
home/Knowledge Base/Security (cPanel)/How to Restrict Access to Directories by IP Address

How to Restrict Access to Directories by IP Address

23 views 0 September 19, 2016 Updated on November 7, 2022 cloudhelp

To secure your admin area from hackers, you should only allow access to your admin directory from selected IP addresses. You can create a dot htaccess file in the directory where you want to restrict access to specific IP addresses.

For example, if you have a WordPress blog installed on your main directory and you log in via cloudwafer.com/blog/wp-admin, you should create an htaccess file in /wp-admin/.htaccess and put the following code into it. Please, don’t forget to replace the allowed IP address with your IP address.

order deny, allow
deny from all
allow from YOUR-IP-ADDRESS-HERE

Replace the Your-IP-Address-Here text with your IP address.

You can test this by accessing the wp-admin directory from another IP address, not mentioned in your htaccess file.

Was this helpful?

Yes  No
Related Articles
  • How to Disable the Two-Factor Authentication on Your cPanel Account
  • How to Enable the Two-Factor Authentication on Your cPanel Account
  • How to Enable or Disable Mod Security in cPanel
  • How to Protect the htaccess File
  • How to Disable Directory Browsing Using the htaccess Rule
  • How to Block Any IP Address via an htaccess Rule

Didn't find your answer? Contact Us

Leave A Comment Cancel reply

Popular Articles
  • How to make payment
  • How to Install Dotclear via Softaculous in SiteWorx
  • How to Remove a Post in WordPress
  • How to Change the VNC Password in SolusVM
  • How to Edit an Account Level/Global Email Filter in cPanel
KB Category
  • Billing
  • Databases (da
  • General (Plesk
  • Softaculous (SiteWorx
  • Domain Management (Plesk
  • Backup/Restore (Plesk
  • Mail Filters & SPAM (DA
  • FileZilla FTP Client
  • others(cpanel
  • SSL
  • Backup/Restore
  • Wordpress
  • DNS – Nameservers
  • Cloudwafer Manager – Hosting
  • SolusVM Basic
  • Security (SiteWorx
  • CloudLinux (DirectAdmin
  • Domain Management
  • cPanel – Control Panel
  • Domain Management (DA
  • WHM
  • Forum(cpanel
  • Forum (SiteWorx
  • Blog (SiteWorx
  • Others (SiteWorx
  • Backup/Restore – SiteWorx
  • Virtualizor Basic
  • SolusVM VPS Management
  • CloudLinux (Plesk
  • Mozilla Thunderbird
  • Domain Management – SiteWorx
  • SiteWorx Basic
  • FTP (Plesk
  • Email (Plesk
  • Backup/Restore (DA
  • Email (DA
  • Email (SiteWorx
  • Virtualizor VPS Management
  • FTP (DA
  • CloudLinux (cPanel
  • DirectAdmin
  • PayPal
  • WHM (For Resellers
  • CMS/Portal (SiteWorx
  • Databases (Plesk
  • Post Features
  • FTP (SiteWorx
  • Databases
  • Installing a Control Panel
  • Android
  • Blog (cPanel
  • CMS/Portal
  • iOS/Apple
  • Outlook 2019
  • Cloudflare (cPanel
  • WHM (Root
  • FTP (cPanel
  • Security (cPanel
  • Softaculous
  • Mail Filters & SPAM – cPanel
  • Email (cPanel

  How to Protect Website Images From Being Displayed at an External Website

How to Block Any IP Address via an htaccess Rule  

Company
  • About us
  • Client Area
Hosting Products
  • Web hosting
  • Dedicated Server
SUPPORT
  • Knowledge Base
  • Faqs
SOCIAL
  • Facebook
  • Twitter
  • Privacy Policy
  • Terms of Use
  • © 2022 CloudWafer. All rights reserved.