Tips with WordPress .htaccess file like?
Where is the htaccess file?
It’s right next to folders like /wp-content, wp-admin, wp-upload
Contents
1. Protect the Admin area on WordPress
You can use the .htaccess file to protect the WordPress admin area.
By only the selected IP addresses are allowed to login to the Admin.
AuthUserFile /dev/null AuthGroupFile /dev/null AuthName "WordPress Admin Access Control" AuthType Basic <limit get> order deny,allow deny from all # whitelist User1 IP address allow from xx.xx.xx.xxx # whitelist User2 IP address allow from xx.xx.xx.xxx # whitelist User3 address allow from xx.xx.xx.xxx # whitelist User4 IP address allow from xx.xx.xx.xxx # whitelist User5 address allow from xx.xx.xx.xxx </limit><div> <span>1</span><span>2</span><span>3</span><span>4</span><span>5</span><span>6</span><span>7</span><span>8</span><span>9</span><span>10</span><span>11</span><span>12</span><span>13</span><span>14</span><span>15</span><span>16</span><span>17</span><span>18</span> </div>
2. Password Protect WordPress Admin Directory
First create a .htpasswd file. Visit this link to create it.
Then upload it outside the /public_html/ directory (not inside)
- /home/user/.htpasswds/
Next, create a .htaccess file
AuthName "Admins Only" AuthUserFile /home/dieuhau/.htpasswds/ AuthGroupFile /dev/null AuthType basic require valid-user<div> <span>1</span><span>2</span><span>3</span><span>4</span><span>5</span> </div>
3. Disable Directory Browsing
Simply add the line of code to the .htaccess file.
Options -Indexes
4. Disable PHP Excecution in some folders
These files often masquerade as the main file and are located in the /wp-includes/ or /wp-content/uploads/ directory.
For added security disable PHP execution in some WordPress directories.
Insert the following code into the htaccess file. (create a new file)
<files> deny from all </files><div> <span>1</span><span>2</span><span>3</span> </div>
5. Protect file wp-config.php
The wp-config.php file is one of the most important files in WordPress
It includes information about the WordPress database and how to connect to the site.
To protect the wp-config.php file from outside snoopers.
Please insert the following code:
<files wp-config.php> order allow,deny deny from all </files><div> <span>1</span><span>2</span><span>3</span><span>4</span> </div>
10. Increase File Upload Size Limit on WordPress
php_value upload_max_filesize 128M php_value post_max_size 128M php_value max_execution_time 300 php_value max_input_time 300<div> <span>1</span><span>2</span><span>3</span><span>4</span> </div>
Epilogue
With just the above simple code, you have shared tips with the WordPress .htaccess file.
If you find it interesting, you can follow the wordpress tips section to know more new knowledge.
Follow fanpage to receive the latest posts: Group
Wish you have interesting and interesting knowledge about wordpress!

