WordPress .htaccess URL Rewrite – Not Control Specific Subfolder

A white, rounded square logo with an abstract S-shaped design on a gradient blue and purple background.

Need to make a file or folder in WordPress not be controlled by the typical permalinks or htaccess file?”  Have some static, dynamic, or other programs that you don’t want controlled by the WordPress publishing system?

Here is how to write a separate .htaccess file to control only that subdirectory of files. The key is only putting the .htaccess file in that directory and leaving WP main .htaccess completely alone.

1.” Write your typical .htaccess file. In our case, we were rewriting simple terms such as:


…to a nice name like


We needed the /law/ directory to be excluded from WordPress typical rewrite to display some custom Google Adwords pages.

2.” Leave alone the main WordPress .htaccess file. It controls everything else except the subfolder you are working with. Don’t touch it, seriously.

3.” Simply put the new .htaccess file in the sub folder of WordPress that you want to use. In our case, our .htaccess language was just the following:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9_-]+)$ index.php?pagetitle=$1
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?pagetitle=$1

BAM, that is it. All done and it works.

Share This

Join the Sales and Marketing News, receive our last insights, tips and best practices.

Our 7 Guarantees

Keeping 2,000+ Clients Happy Since 2001.

You Will Love Your Design We design to please you and your clients
Same-Day Support 24-hour turnaround edits during business hours
Free Education We provide knowledge to help you expand
No Hidden Charges We quote flat-rate projects
Own Your Site No strings attached
We Create Results SEO, PPC, content + design = clients
We Make Life Easier One agency for web, branding and marketing