htaccess.madewithlove.com
htaccess.madewithlove.com copied to clipboard
PT flag does not seem to work for RewriteRule entries
The following example does not follow through to the second rewrite rule
RewriteEngine On
RewriteBase /
# Drupal node to wordpress url mapping
RewriteCond %{QUERY_STRING} ^q=content\/(.*)$
RewriteRule . /drupal/%1? [PT]
RewriteRule drupal/example-article /2016/09/12/example-article/ [R=permanent,L]
I can confirm that this does work in a live environment.
Cheers, Ty
I guess you are right, RewriteRule always showing as "not met" while it actually works. (Not just for PT flags)
My example:
RewriteCond %{QUERY_STRING} .redirectURL. [NC] RewriteCond %{QUERY_STRING} !.redirectURL=(/|%2f). [NC] RewriteRule ^/logoff.html(.*) - [F]