To exclude folders from within the WordPress permalink rewrite rules, you’ll need to make a few changes within your htaccess file. This should be done incase you have other applications in sub-directories, which have their own htaccess files with their own rewrite rules. To do this, please follow the step-by-step outline below.
- Login to your cPanel web hosting account via FTP
- Navigate to your /public_html/ folder
- Locate the htaccess file and edit the htaccess file
- Locate the following code within the htaccess file:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
- Once that’s done, you’ll need to replace the above code with:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ./ /index.php [L]
</IfModule>
# END WordPress
- Once you’ve made the appropriate changes above, simply save and re-upload the htaccess file to the /public_html/ directory.
If you have any further questions about WordPress, please feel free to reach out to our web hosting support team for further assistance.
Yes this .htaccess addition is responsible for mod_rewrite and Wordpress SEO addresses. Sometimes Wordpress installations are missing it especially installed via Softaculous.
Posted by Greta - Wed, Jul 25th, 2012 12:12 PM