Knowledge Base » WordPress FAQs

How do I exclude folders from WordPress permalinks?

Art. Nr: 534  |  Rating: 4/5 from 521 votes  |  Last Updated: Mon, Oct 17, 2011
starstarstarstarstar

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.

Comments

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

Thats really helpful and advanced Wordpress help article. Coming here always to read professionally written WP articles. Keep adding more and more Wordpress knowledbase articles.

Posted by Sandy64 - Fri, Apr 6th, 2012 12:29 PM

Post your Comments

Popular Tutorials

RSS Feed
Please see below, some related knowledge base tutorials, which are related to your search query. Please feel free to contact us if you are not able to find what you are looking for.