WordPress® .htaccess URL Rewrite – Not Control Specific Subfolder
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.
About Us
Did you know more than 200 clients have worked with PaperStreet for more than 10 years?