Lets say I want to rewrite URLs from one subdirectory to another (my actual use case is a bit more complicated but this is a simpler example):
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^pretty_prefix/(.*)$ ugly_dir_name/$1
</IfModule>
The plan is that the user sees URLs like:
mysite.com/pretty_prefix/...
instead of
mysite.com/ugly_dir_name/...
Inside public_html/ugly_dir_name
there's a .htaccess
file like the following:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ugly_dir_name/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ugly_dir_name/index.php [L]
</IfModule>
Unfortunately, it seems as though Wordpress, after catching the URL with the last catch all rule, is doing something that results in the pretty URL not being displayed to the user.
Is there anyway to fix this?