WordPress

Guide :- WordPress “.htaccess” Rules with Examples

In this article I will cover just about WordPress .htaccess rules for a directory. The main purpose of this rule set is to allow arbitrary paths (permalinks) be sent to the proper WordPress script without causing file/path not found 404 errors. If you see your permalinks is working but there are no .htaccess file on document root, it is because it is hidden. In Linux OS all filename beginning with a dot (.) treats as a hidden file. You can enable FTP client to enable viewing of all hidden files.

If WordPress Is Installed In the Site’s Root Directory

If your WordPress is installed in the site’s root directory, It creates and uses the following htaccess directives:

# BEGIN WordPress

 RewriteEngine On
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /index.php [L]

# END WordPress

If WordPress Is Installed In the Some Subdirectory

If your WordPress is installed in some subdirectory such “site”, It creates and uses the following htaccess directives:

# BEGIN WordPress

 RewriteEngine On
 RewriteBase /site/
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule . /site/index.php [L]

# END WordPress

Thanks:)

Thank you! for visiting LookLinux.

If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.

About the author

mm

Santosh Prasad

Hi! I'm Santosh and I'm here to post some cool article for you. If you have any query and suggestion please comment in comment section.

Leave a Comment