WizSeller Help Desk Latest Questions

Enabling .htaccess on Your Linux Server

Wizseller Helpdesk
WordPress Expert (15 Years)

When you install Joomla or WordPress you will find a htaccess.txt file in your public_html directory. It needs to be customized and renamed in order to function properly on your server.

The htaccess file serves to give a directive to the server.

To enable do this:

  1. Go to your Global configuration in Joomla Administration.
  2. Select the first top three buttons.
  3. With an editor like Dreamweaver, rename htaccess.txt to .htaccess
  4. Save

Basic WP

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

MultiSite

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]

Password Protect Log In
Protect log in

<Files wp-login.php>
AuthType Basic
AuthName "Password Protected"
AuthUserFile /full/path/to/.htpasswd
Require valid-user
Satisfy All
</Files>

Requires specific IP

ErrorDocument 401 default
ErrorDocument 403 default

<Files wp-login.php>
Order deny,allow
Deny from all
Allow from 198.101.159.98 localhost
</Files>

Recommendation, avoid filling up you htaccess file with deny I.P’s etc. Slows down your site.

Leave an answer

Leave an answer

Captcha Click on image to update the captcha.

This site uses User Verification plugin to reduce spam. See how your comment data is processed.