Restrict access with .htaccess

Redirect or restrict access to a directory with .htaccess

A very important action is the restriction of the administration directory of our website such as: wp-admin in WordPress, administrator in Joomla and other directories or subdirectories that could compromise the stability or security of our website.

To avoid unauthorized access to a directory or subdirectory of our website, we simply create a .htaccess file with the following instruction, substituting the local IP address and publishing for ours, we can also redirect the not allowed access to a specific URL. Once created we upload it to the root directory from which we want to prevent access.

RewriteEngine on
Options +FollowSymlinks

#Redirect
ErrorDocument 403 https://midominio.com/
order deny,allow
deny from all
allow from Public IP
allow from local IP

If you have any questions, please feel free to contact Picaraza Domains support team 24/7/365.

Was this answer helpful?

Related Articles

Files .htaccess

What we can use a .htaccess file for The .htaccess (hypertext access) file is a supported...

Redirection to Port 443/http

Redirection of our website to Port 443/https In many cases, redirection to port 443 or HTTPS...

Redirection with www

Web domain redirection with (www) In the SEO optimization of our website, it is very important...

Enable WordPress write permissions

WordPress rewrite permissions We can enable rewriting permissions in WordPress by creating a...