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:

http://www.domain.com/law/index.php?pagetitle=Headline

…to a nice name like

http://www.domain.com/law/Headline

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:

#LANDING PAGES
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
Blog Decorative Background

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

Our 7 Guarantees

Keeping 2,000+ Clients Happy Since 2001.

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