sergiozambrano
Technical User
I wrote a regex for a rewrite rule that includes a negative lookahead to replace the rewriteCond line, because WordPress only accepts two values: pattern -> substitution.
It should find findme.html _here, regardless of where it's requested to be:
mydomain.com/_here/findme.html
e.g.
(Sorry, I can't modify the swf which will request findme.html in the wrong places)
So, given findme.html could be requested to be in, e.g.:
mydomain.com/findme.html
mydomain.com/directory/findme.html
mydomain.com/directory/findme.html?someparam=3
The rewrite should make them all
mydomain.com/_here/findme.html
So, I made a rewrite rule that Wordpress will accept, with a negative lookahead so it only matches URLs which dont contain "_here/" already, as follow
The problem is IT DOES loop.
What did I miss?
(I tested it with no other code in the .htaccess file, still looping)
It should find findme.html _here, regardless of where it's requested to be:
mydomain.com/_here/findme.html
e.g.
(Sorry, I can't modify the swf which will request findme.html in the wrong places)
So, given findme.html could be requested to be in, e.g.:
mydomain.com/findme.html
mydomain.com/directory/findme.html
mydomain.com/directory/findme.html?someparam=3
The rewrite should make them all
mydomain.com/_here/findme.html
So, I made a rewrite rule that Wordpress will accept, with a negative lookahead so it only matches URLs which dont contain "_here/" already, as follow
Code:
Options +FollowSymlinks
RewriteEngine On
RewriteRule ^.*?(?!_here/)findme\.html$ /_here/findme.html [R=301,L]
The problem is IT DOES loop.
What did I miss?
(I tested it with no other code in the .htaccess file, still looping)